monitor

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFreeCommandOutputAsArr

func GetFreeCommandOutputAsArr(row int) []string

GetFreeCommandOutputAsArr return `free` output

func IsServiceUp

func IsServiceUp(serviceName string) bool

IsServiceUp returns true if service is running

func MonitorAsJSON

func MonitorAsJSON(config config.Config) string

Types

type CustomMetric

type CustomMetric struct {
	Name     string
	Unit     string
	Value    string
	ServerId string
	Time     string
}

type Disk

type Disk struct {
	FileSystem      string
	MountPoint      string
	Type            string
	Size            string
	Used            string
	Free            string
	PercentageUsed  string
	Inodes          string
	IUsed           string
	IFree           string
	IPercentageUsed string
	Time            string
}

Disk struct with disk info

func GetDisks

func GetDisks(time string, config config.Config) []Disk

GetDisks returns an array of Disk structs

type Memory

type Memory struct {
	Used           string
	Free           string
	Total          string
	PercentageUsed string
	Time           string
}

Memory struct with memory info

func GetMemory

func GetMemory() Memory

GetMemory returns Memory struct

type MonitorData

type MonitorData struct {
	UnixTime    string
	System      System
	Memory      Memory
	Swap        Swap
	Disks       []Disk
	Processor   Processor
	ProcUsage   ProcessorUsage
	Networks    []Network
	MemoryUsage []Process
	CpuUsage    []Process
	Services    []Service
	ServerId    string
}

func Monitor

func Monitor(config config.Config) MonitorData

type Network

type Network struct {
	Interface string
	IP        string
	Tx        string
	Rx        string
	Time      string
}

Network struct with network info

func GetNetwork

func GetNetwork(time string) []Network

GetNetwork returns a Network struct

type Process

type Process struct {
	User        string
	PID         string
	CPUUsage    string
	MemoryUsage string
	Command     string
	Time        string
}

Process struct with process info

func GetProcessesSortedByCPU

func GetProcessesSortedByCPU(time string) []Process

GetProcessesSortedByCPU returns a Process struct

func GetProcessesSortedByMem

func GetProcessesSortedByMem(time string) []Process

GetProcessesSortedByMem returns a Process struct

type Processor

type Processor struct {
	Model     string
	NoOfCores string
	Freq      string
	Cache     string
	Temp      string
	LoadAvg   string
	Time      string
}

Processor struct with processor info

func GetProcessor

func GetProcessor() Processor

GetProcessor returns a Processor struct

type ProcessorUsage

type ProcessorUsage struct {
	Temp    string
	LoadAvg string
	Time    string
}

ProcessorUsage struct with processor usage info

func GetProcessorUsage

func GetProcessorUsage() ProcessorUsage

GetProcessorUsage returns a ProcessorUsage struct

type Service

type Service struct {
	Name    string
	Running bool
	Time    string
}

Service holds service activity info

func GetServices

func GetServices(unixTime string, config config.Config) []Service

type Swap

type Swap struct {
	Used           string
	Free           string
	Total          string
	PercentageUsed string
	Time           string
}

Swap struct with Swap info

func GetSwap

func GetSwap() Swap

GetSwap returns Swap struct

type System

type System struct {
	HostName      string
	OS            string
	Kernel        string
	UpTime        string
	LastBootDate  string
	NoOfCurrUsers string
	DateTime      string
	Time          string
}

System struct with system info

func GetSystem

func GetSystem() System

GetSystem returns System struct

Jump to

Keyboard shortcuts

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