disk

package
v0.0.0-...-4e39a2f Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2022 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const FATAL = "fatal"

FATAL represents fatal severity

View Source
const INFO = "info"

INFO represents info severity

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Threshold is the percentage disk usage required to driver an alert
	Threshold int

	// alert interface
	Alert alert.Alert

	// State interface
	State backend.State

	// Host is the system being managed by this config
	Host System
}

Config type represents the configuration for disk-usage checking and alerting

func (Config) ReadState

func (c Config) ReadState() (State, error)

func (*Config) Run

func (c *Config) Run() error

Run will execute disk usage checks and alerts

func (Config) WriteState

func (c Config) WriteState(s State) error

type Device

type Device struct {
	Name         string `json:"name"`
	MountPoint   string `json:"mountpoint"`
	Type         string `json:"type"`
	UsagePercent int    `json:"usage_percent"`
	Healthy      bool   `json:"healthy"`
}

Device represents a device attached to the system

type State

type State struct {
	Alerted []string `json:"alerted"`
	Host    System   `json:"host"`
}

State represents the state written to the state backend

type System

type System struct {
	Name    string   `json:"name"`
	Address string   `json:"address"`
	Devices []Device `json:"devices"`
}

System represents the local system

Jump to

Keyboard shortcuts

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