Documentation ¶
Overview ¶
Package disk tracks the disk usage of all the mount points specified in the configuration.
Index ¶
Constants ¶
View Source
const ( StateNameDiskExtPartition = "disk_ext_partition" StateKeyDiskPartitionDevice = "device" StateKeyDiskPartitionMountPoint = "mount_point" StateKeyDiskPartitionFstype = "fstype" StateNameDiskUsage = "disk_usage" StateKeyDiskUsageMountPoint = "mount_point" StateKeyDiskUsageFstype = "fstype" StateKeyDiskUsageTotalBytes = "total_bytes" StateKeyDiskUsageTotalHumanized = "total_humanized" StateKeyDiskUsageFreeBytes = "free_bytes" StateKeyDiskUsageFreeHumanized = "free_humanized" StateKeyDiskUsageUsedBytes = "used_bytes" StateKeyDiskUsageUsedHumanized = "used_humanized" StateKeyDiskUsageUsedPercent = "used_percent" StateKeyDiskUsageInodesTotal = "inodes_total" StateKeyDiskUsageInodesUsed = "inodes_used" StateKeyDiskUsageInodesFree = "inodes_free" StateKeyDiskUsageInodesUsedPercent = "inodes_used_percent" )
View Source
const Name = "disk"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Query query_config.Config `json:"query"` MountPoints []string `json:"mount_points"` }
func DefaultConfig ¶
func DefaultConfig() Config
type Output ¶
type Output struct { ExtPartitions []Partition `json:"ext_partitions"` Usages []Usage `json:"usages"` }
func ParseOutputJSON ¶
func ParseStatesToOutput ¶
func ParseStatesToOutput(states ...components.State) (*Output, error)
type Partition ¶
type Usage ¶
type Usage struct { MountPoint string `json:"path"` Fstype string `json:"fstype"` TotalBytes uint64 `json:"total_bytes"` TotalHumanized string `json:"total_humanized"` FreeBytes uint64 `json:"free_bytes"` FreeHumanized string `json:"free_humanized"` UsedBytes uint64 `json:"used_bytes"` UsedHumanized string `json:"used_humanized"` UsedPercent string `json:"used_percent"` UsedPercentFloat float64 `json:"-"` InodesTotal uint64 `json:"inodes_total"` InodesUsed uint64 `json:"inodes_used"` InodesFree uint64 `json:"inodes_free"` InodesUsedPercent string `json:"inodes_used_percent"` InodesUsedPercentFloat float64 `json:"-"` }
func (Usage) GetUsedPercent ¶
Click to show internal directories.
Click to hide internal directories.