check

package
v0.0.0-...-9e745d5 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2020 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitGetResponseAllData

func InitGetResponseAllData(project string) (responsealldata *[]service.Service, err error)

InitGetResponseAllData - function to obtain information about all services from the database. all services are append to slice Services

Types

type CheckCPU

type CheckCPU struct {
	Status string `json:"status"`
	Data   struct {
		ResultType string `json:"resulttype"`
		Result     []struct {
			Metric struct {
				Instance string `json:"instance"`
			} `json:"metric"`
			Value []interface{} `json:"value"`
		} `json:"result"`
	} `json:"data"`
}

CheckCPU - data structure obtained from prometheus on CPU usage on hosts

type CheckHDD

type CheckHDD struct {
	Status string `json:"status"`
	Data   struct {
		ResultType string `json:"resultType"`
		Result     []struct {
			Metric struct {
				Device     string `json:"device"`
				Fstype     string `json:"fstype"`
				Instance   string `json:"instance"`
				Job        string `json:"job"`
				Mountpoint string `json:"mountpoint"`
			} `json:"metric"`
			Value []interface{} `json:"value"`
		} `json:"result"`
	} `json:"data"`
}

CheckHDD - The structure of the building is data obtained from the use of hard disks, on all monitored hosts, in terms of mount points.

type CheckMemory

type CheckMemory struct {
	Status string `json:"status"`
	Data   struct {
		ResultType string `json:"resultType"`
		Result     []struct {
			Metric struct {
				Instance string `json:"instance"`
				Job      string `json:"job"`
			} `json:"metric"`
			Value []interface{} `json:"value"`
		} `json:"result"`
	} `json:"data"`
}

CheckMemory - data structure obtained from prometheus on memory usage on hosts

type Host

type Host struct {
	Host   string `json:"host"`
	CPU    string `json:"CPU"`
	HDD    string `json:"HDD"`
	Memory string `json:"Memory"`
}

Host - struct for host info, contains host(IP addr),CPU value,HDD value,Memory value

type Monitoring

type Monitoring struct {
	ID     int64  `json:"id"`
	Name   string `json:"name,omitempty"`
	Host   string `json:"host,omitempty"`
	Status bool   `json:"status,omitempty"`
}

Monitoring - struct for Monitoring info, contains name,host(IP addr) and launch status

type Result

type Result struct {
	sync.RWMutex
	ServiceRS []ServerRS `json:"services"`
	//Monitoring []Monitoring `json:"Monitoring"`
	Hosts struct {
		PrometheusState bool   `json:"prometheusstate"`
		Нost            []Host `json:"hosts,omitempty"`
	} `json:"hosts"`
}

Result - result structure, contains the stend status, slice monitoring services/host slice and their status.

func CheckStend

func CheckStend(getResponceAllData *[]service.Service) (*Result, error)

CheckStend - function to check stehd, checks the status of monitoring agents, memory utilization, hard disks and processors.

type ServerRS

type ServerRS struct {
	ID     int64 `json:"id"`
	Status bool  `json:"status"`
}

ServerRS - struct from response server status ad id

Jump to

Keyboard shortcuts

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