status

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToUnit

func ConvertToUnit(b uint64, e string) float64

func HandleCPU

func HandleCPU(cv config.Values) interface{}

func HandleDisks

func HandleDisks(cv config.Values) interface{}

func HandleDocker

func HandleDocker(cv config.Values) interface{}

func HandleInodes

func HandleInodes(cv config.Values) interface{}

func HandleLoad

func HandleLoad(cv config.Values) interface{}

func HandleMemory

func HandleMemory(cv config.Values) interface{}

func HandleNetworks

func HandleNetworks(cv config.Values) interface{}

Get a whole list of interfaces

func HandlePlugins

func HandlePlugins(cv config.Values) interface{}

func HandleProcesses

func HandleProcesses(cv config.Values) interface{}

func HandleServices

func HandleServices(cv config.Values) interface{}

func HandleSwap

func HandleSwap(cv config.Values) interface{}

func HandleSystem

func HandleSystem(cv config.Values) interface{}

func HandleTemps

func HandleTemps(cv config.Values) interface{}

func HandleUsers

func HandleUsers(cv config.Values) interface{}

func HandleVersion

func HandleVersion(cv config.Values) interface{}

func Setup

func Setup()

Save initial counters for per second values

Types

type CPUStatus

type CPUStatus struct {
	Percent []float64 `json:"percent"`
	Units   string    `json:"units"`
	// contains filtered or unexported fields
}

func (CPUStatus) CheckValue

func (c CPUStatus) CheckValue() float64

func (CPUStatus) LongOutput

func (c CPUStatus) LongOutput() string

func (CPUStatus) PerfData

func (c CPUStatus) PerfData(warn, crit string) string

func (CPUStatus) String

func (c CPUStatus) String() string

type CheckResult

type CheckResult struct {
	Exitcode   int    `json:"exitcode"`
	Output     string `json:"output"`
	Perfdata   string `json:"perfdata"`
	LongOutput string `json:"longoutput"`
}

func GetCheckAgainstResult

func GetCheckAgainstResult(chk CheckableAgainst, e string) CheckResult

func GetCheckResult

func GetCheckResult(chk Checkable, w, c string) CheckResult

func (*CheckResult) String

func (c *CheckResult) String() string

type Checkable

type Checkable interface {
	CheckValue() float64
	String() string
	PerfData(string, string) string
}

type CheckableAgainst

type CheckableAgainst interface {
	CheckValue() string
	String() string
}

type CheckableExtra

type CheckableExtra interface {
	LongOutput() string
}

type Disk

type Disk struct {
	Path        string  `json:"path"`
	Device      string  `json:"device"`
	Fstype      string  `json:"fstype"`
	Total       float64 `json:"total"`
	Free        float64 `json:"free"`
	Used        float64 `json:"used"`
	UsedPercent float64 `json:"usedPercent"`
	Units       string  `json:"units"`
}

func (Disk) CheckValue

func (d Disk) CheckValue() float64

func (Disk) PerfData

func (d Disk) PerfData(warn, crit string) string

func (Disk) String

func (d Disk) String() string

type Inodes

type Inodes struct {
	Path        string  `json:"path"`
	Device      string  `json:"device"`
	Fstype      string  `json:"fstype"`
	Total       float64 `json:"total"`
	Used        float64 `json:"used"`
	Free        float64 `json:"free"`
	UsedPercent float64 `json:"usedPercent"`
}

func (Inodes) CheckValue

func (i Inodes) CheckValue() float64

func (Inodes) PerfData

func (i Inodes) PerfData(warn, crit string) string

func (Inodes) String

func (i Inodes) String() string

type Interface

type Interface struct {
	HardwareAddr string                `json:"hardwareAddr"`
	Addrs        net.InterfaceAddrList `json:"addrs"`

	net.IOCountersStat
	// contains filtered or unexported fields
}

type InterfaceDelta

type InterfaceDelta struct {
	HardwareAddr string                `json:"hardwareAddr"`
	Addrs        net.InterfaceAddrList `json:"addrs"`
	net.IOCountersStat
	InterfaceDeltaStat
}

type InterfaceDeltaStat added in v1.0.3

type InterfaceDeltaStat struct {
	OutTotal  float64 `json:"outTotal"`
	OutPerSec float64 `json:"outPerSec"`
	InTotal   float64 `json:"inTotal"`
	InPerSec  float64 `json:"inPerSec"`
	Units     string  `json:"units"`
	// contains filtered or unexported fields
}

func (InterfaceDeltaStat) CheckValue added in v1.0.3

func (i InterfaceDeltaStat) CheckValue() float64

func (InterfaceDeltaStat) PerfData added in v1.0.3

func (i InterfaceDeltaStat) PerfData(warn, crit string) string

func (InterfaceDeltaStat) String added in v1.0.3

func (i InterfaceDeltaStat) String() string

type Load

type Load struct {
	Load1  float64 `json:"load1"`
	Load5  float64 `json:"load5"`
	Load15 float64 `json:"load15"`
	// contains filtered or unexported fields
}

func (Load) CheckValue

func (l Load) CheckValue() float64

func (Load) PerfData

func (l Load) PerfData(warn, crit string) string

func (Load) String

func (l Load) String() string

type MemoryStatus

type MemoryStatus struct {
	Total       float64 `json:"total"`
	Available   float64 `json:"available"`
	Free        float64 `json:"free"`
	Used        float64 `json:"used"`
	UsedPercent float64 `json:"usedPercent"`
	Units       string  `json:"units"`
}

func (MemoryStatus) CheckValue

func (m MemoryStatus) CheckValue() float64

func (MemoryStatus) PerfData

func (m MemoryStatus) PerfData(warn, crit string) string

func (MemoryStatus) String

func (m MemoryStatus) String() string

type Plugin

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

func (*Plugin) CreateCmd

func (p *Plugin) CreateCmd() error

func (*Plugin) Run

func (p *Plugin) Run() PluginResults

type PluginResults

type PluginResults struct {
	Output   string `json:"output"`
	ExitCode int    `json:"exitcode"`
}

type Process

type Process struct {
	Name       string   `json:"name"`
	PID        int32    `json:"pid"`
	Exe        string   `json:"exe"`
	Cmdline    string   `json:"cmdline"`
	Username   string   `json:"username"`
	CPUPercent float64  `json:"cpuPercent"`
	MemPercent float64  `json:"memPercent"`
	Status     []string `json:"status"`
}

type ProcessList

type ProcessList struct {
	Count     int       `json:"count"`
	Processes []Process `json:"processes"`
}

func (ProcessList) CheckValue

func (p ProcessList) CheckValue() float64

func (ProcessList) PerfData

func (p ProcessList) PerfData(warn, crit string) string

func (ProcessList) String

func (p ProcessList) String() string

type Service

type Service struct {
	Name   string `json:"name"`
	Status string `json:"status"`
	// contains filtered or unexported fields
}

func (Service) CheckValue

func (s Service) CheckValue() string

func (Service) String

func (s Service) String() string

type SwapStatus

type SwapStatus struct {
	Total       float64 `json:"total"`
	Free        float64 `json:"free"`
	Used        float64 `json:"used"`
	UsedPercent float64 `json:"usedPercent"`
	Units       string  `json:"units"`
}

func (SwapStatus) CheckValue

func (s SwapStatus) CheckValue() float64

func (SwapStatus) PerfData

func (s SwapStatus) PerfData(warn, crit string) string

func (SwapStatus) String

func (s SwapStatus) String() string

type Users

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

func (Users) CheckValue

func (u Users) CheckValue() float64

func (Users) PerfData

func (u Users) PerfData(warn, crit string) string

func (Users) String

func (u Users) String() string

type Version

type Version struct {
	Version string `json:"version"`
}

func (Version) CheckValue

func (v Version) CheckValue() float64

func (Version) PerfData

func (v Version) PerfData(warn, crit string) string

func (Version) String

func (v Version) String() string

Jump to

Keyboard shortcuts

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