beater

package
v0.0.0-...-0a615c9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 24, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DatasetFilesystem = "filesystem"
	DatasetSnapshot   = "snapshot"
	DatasetVolume     = "volume"
)

ZFS dataset types, which can indicate if a dataset is a filesystem, snapshot, or volume.

View Source
const (
	ZpoolOnline   = "ONLINE"
	ZpoolDegraded = "DEGRADED"
	ZpoolFaulted  = "FAULTED"
	ZpoolOffline  = "OFFLINE"
	ZpoolUnavail  = "UNAVAIL"
	ZpoolRemoved  = "REMOVED"
)

ZFS zpool states, which can indicate if a pool is online, offline, degraded, etc

Variables

This section is empty.

Functions

func New

func New(b *beat.Beat, cfg *common.Config) (beat.Beater, error)

New creates an instance of zfsbeat.

Types

type Dataset

type Dataset struct {
	Name                 string
	Available            string
	Clones               string
	Compressratio        string
	Creation             string
	DeferDestroy         string
	Logicalreferenced    string
	Logicalused          string
	Mounted              string
	Origin               string
	Refcompressratio     string
	Referenced           string
	Type                 string
	Used                 string
	Usedbychildren       string
	Usedbydataset        string
	Usedbyrefreservation string
	Usedbysnapshots      string
	Userrefs             string
	Written              string
	Aclinherit           string
	Acltype              string
	Atime                string
	Canmount             string
	Casesensitivity      string
	Checksum             string
	Compression          string
	Context              string
	Copies               string
	Dedup                string
	Defcontext           string
	Devices              string
	Exec                 string
	FilesystemCount      string
	FilesystemLimit      string
	Fscontext            string
	Logbias              string
	Mlslabel             string
	Mountpoint           string
	Nbmand               string
	Normalization        string
	Overlay              string
	Primarycache         string
	Quota                string
	Readonly             string
	Recordsize           string
	RedundantMetadata    string
	Refquota             string
	Refreservation       string
	Relatime             string
	Reservation          string
	Rootcontext          string
	Secondarycache       string
	Setuid               string
	Sharenfs             string
	Sharesmb             string
	Snapdev              string
	Snapdir              string
	SnapshotCount        string
	SnapshotLimit        string
	Sync                 string
	Utf8only             string
	Version              string
	Volblocksize         string
	Volsize              string
	Vscan                string
	Xattr                string
	Zoned                string
}

Dataset is a ZFS dataset. A dataset could be a clone, filesystem, snapshot, or volume. The Type struct member can be used to determine a dataset's type.

The field definitions can be found in the ZFS manual: http://www.freebsd.org/cgi/man.cgi?zfs(8).

func Datasets

func Datasets(filter string) ([]*Dataset, error)

Datasets returns a slice of ZFS datasets, regardless of type. A filter argument may be passed to select a dataset with the matching name, or empty string ("") may be used to select all datasets.

func Filesystems

func Filesystems(filter string) ([]*Dataset, error)

Filesystems returns a slice of ZFS filesystems. A filter argument may be passed to select a filesystem with the matching name, or empty string ("") may be used to select all filesystems.

func GetDataset

func GetDataset(name string) (*Dataset, error)

GetDataset retrieves a single ZFS dataset by name. This dataset could be any valid ZFS dataset type, such as a clone, filesystem, snapshot, or volume.

func Snapshots

func Snapshots(filter string) ([]*Dataset, error)

Snapshots returns a slice of ZFS snapshots. A filter argument may be passed to select a snapshot with the matching name, or empty string ("") may be used to select all snapshots.

func Volumes

func Volumes(filter string) ([]*Dataset, error)

Volumes returns a slice of ZFS volumes. A filter argument may be passed to select a volume with the matching name, or empty string ("") may be used to select all volumes.

func (*Dataset) Snapshots

func (d *Dataset) Snapshots() ([]*Dataset, error)

Snapshots returns a slice of all ZFS snapshots of a given dataset.

type Error

type Error struct {
	Err    error
	Debug  string
	Stderr string
}

Error is an error which is returned when the `zfs` or `zpool` shell commands return with a non-zero exit code.

func (Error) Error

func (e Error) Error() string

Error returns the string representation of an Error.

type Zfsbeat

type Zfsbeat struct {
	// contains filtered or unexported fields
}

Zfsbeat configuration.

func (*Zfsbeat) Run

func (bt *Zfsbeat) Run(b *beat.Beat) error

Run starts zfsbeat.

func (*Zfsbeat) Stop

func (bt *Zfsbeat) Stop()

Stop stops zfsbeat.

type Zpool

type Zpool struct {
	Name                     string
	Size                     uint64
	Capacity                 uint64
	Altroot                  string
	Health                   string
	GUID                     string
	Version                  string
	Bootfs                   string
	Delegation               string
	Autoreplace              string
	Cachefile                string
	Failmode                 string
	Listsnapshots            string
	Autoexpand               string
	Dedupditto               string
	Dedupratio               float64
	Free                     uint64
	Allocated                uint64
	Readonly                 string
	Ashift                   uint64
	Comment                  string
	Expandsize               uint64
	Freeing                  uint64
	Fragmentation            uint64
	Leaked                   uint64
	FeatureAsyncDestroy      string
	FeatureEmptyBpobj        string
	FeatureLz4Compress       string
	FeatureSpacemapHistogram string
	FeatureEnabledTxg        string
	FeatureHoleBirth         string
	FeatureExtensibleDataset string
	FeatureEmbeddedData      string
	FeatureBookmarks         string
	FeatureFilesystemLimits  string
	FeatureLargeBlocks       string
}

Zpool is a ZFS zpool. A pool is a top-level structure in ZFS, and can contain many descendent datasets.

func GetZpool

func GetZpool(name string) (*Zpool, error)

GetZpool retrieves a single ZFS zpool by name.

func ListZpools

func ListZpools() ([]*Zpool, error)

ListZpools list all ZFS zpools accessible on the current system.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL