check

package
v0.86.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package check contains the code to parse the check command output

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aggregator

type Aggregator struct {
	Metrics       []Metric       `json:"metrics"`
	ServiceChecks []ServiceCheck `json:"service_checks"`
	Events        []Event        `json:"events"`
}

Aggregator contains the metrics emitted by a check

type Event

type Event struct {
	Title     string `json:"msg_title"`
	Text      string `json:"msg_text"`
	Host      string `json:"host"`
	Timestamp int64  `json:"timestamp"`
	Priority  string `json:"priority"`
	AlertType string `json:"alert_type"`
}

Event represents a event emitted by a check

type Metric

type Metric struct {
	Host           string      `json:"host"`
	Interval       int         `json:"interval"`
	Metric         string      `json:"metric"`
	Points         [][]float64 `json:"points"`
	SourceTypeName string      `json:"source_type_name"`
	Tags           []string    `json:"tags"`
	Type           string      `json:"type"`
}

Metric represents a metric emitted by a check

type Root

type Root struct {
	Aggregator Aggregator `json:"aggregator"`
	Runner     Runner     `json:"runner"`
}

Root is the root object of the check command output

func ParseJSONOutput

func ParseJSONOutput(t *testing.T, check []byte) []Root

ParseJSONOutput parses the check command json output

type Runner

type Runner struct {
	TotalRuns     int `json:"TotalRuns"`
	TotalErrors   int `json:"TotalErrors"`
	TotalWarnings int `json:"TotalWarnings"`
}

Runner contains the check execution information

type ServiceCheck

type ServiceCheck struct {
	Name      string   `json:"check"`
	Host      string   `json:"host_name"`
	Status    int      `json:"status"`
	Timestamp int64    `json:"timestamp"`
	Message   string   `json:"message"`
	Tags      []string `json:"tags"`
}

ServiceCheck represents a service check emitted by a check

Jump to

Keyboard shortcuts

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