monitoring

package
v0.0.0-...-cba5bb6 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2020 License: Zlib Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const MIN_NOTIFICATION_TIME = float64(3600)

Variables

This section is empty.

Functions

func Hostname

func Hostname() string

func InitNode

func InitNode(db *gorm.DB, kind string, text string, schedule float64) error

func MustInitNode

func MustInitNode(db *gorm.DB, kind string, text string, schedule float64)

func MustTick

func MustTick(db *gorm.DB, kind string)

func Tick

func Tick(db *gorm.DB, kind string) error

Types

type DiskIOPerNode

type DiskIOPerNode struct {
	ID     uint64 `gorm:"primary_key"`
	Kind   string `gorm:"type:varchar(255) not null"`
	NodeID string `gorm:"type:varchar(255) not null"`

	DiskReadsCompleted  uint64
	DiskWritesCompleted uint64

	CreatedAt time.Time
}

func GetDiskIOStats

func GetDiskIOStats(diskName string) DiskIOPerNode

type DiskMDPerNode

type DiskMDPerNode struct {
	ID     uint64 `gorm:"primary_key"`
	Kind   string `gorm:"type:varchar(255) not null"`
	NodeID string `gorm:"type:varchar(255) not null"`

	ExitCode int
	MDADM    string `gorm:"type:text not null"`

	CreatedAt time.Time
}

func GetMDADM

func GetMDADM(md string) DiskMDPerNode

type DiskUsagePerNode

type DiskUsagePerNode struct {
	ID     uint64 `gorm:"primary_key"`
	Kind   string `gorm:"type:varchar(255) not null"`
	NodeID string `gorm:"type:varchar(255) not null"`

	DiskAll  uint64
	DiskUsed uint64
	DiskFree uint64

	CreatedAt time.Time
}

func GetDiskUsage

func GetDiskUsage(path string) DiskUsagePerNode

type MemStatsPerNode

type MemStatsPerNode struct {
	ID     uint64 `gorm:"primary_key"`
	NodeID string `gorm:"type:varchar(255) not null"`

	MemoryTotal      uint64
	MemoryUsed       uint64
	MemoryBuffers    uint64
	MemoryCached     uint64
	MemoryFree       uint64
	MemoryAvailable  uint64
	MemoryActive     uint64
	MemoryInactive   uint64
	MemorySwapTotal  uint64
	MemorySwapUsed   uint64
	MemorySwapCached uint64
	MemorySwapFree   uint64
	CreatedAt        time.Time
}

func GetMemoryStats

func GetMemoryStats() MemStatsPerNode

type MonitoringPerNode

type MonitoringPerNode struct {
	ID             uint64 `gorm:"primary_key"`
	Kind           string `gorm:"type:varchar(255) not null"`
	NodeID         string `gorm:"type:varchar(255) not null"`
	AlertText      string `gorm:"type:text not null"`
	Schedule       float64
	Tick           time.Time
	NotifiedAt     *time.Time
	AcknowledgedAt *time.Time
	CreatedAt      time.Time
	UpdatedAt      time.Time
}

func Watch

func Watch(db *gorm.DB) ([]*MonitoringPerNode, error)

func (*MonitoringPerNode) String

func (m *MonitoringPerNode) String() string

type Stats

type Stats struct {
	Mem    []MemStatsPerNode
	DU     []DiskUsagePerNode
	IO     []DiskIOPerNode
	MDADM  []DiskMDPerNode
	Watch  []MonitoringPerNode
	NodeID string
}

func GetStats

func GetStats(db *gorm.DB, node_id string, n int) ([]*Stats, error)

func (*Stats) ASCII

func (s *Stats) ASCII(w io.Writer, height int)

Jump to

Keyboard shortcuts

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