a008

package
v0.0.0-...-b15899e Latest Latest
Warning

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

Go to latest
Published: May 7, 2021 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const A008_NFS_DISK string = "A008_NFS_DISK"
View Source
const A008_NOT_RECOMMENDED_FS string = "A008_NOT_RECOMMENDED_FS"
View Source
const A008_SPACE_USAGE_CRITICAL string = "A008_SPACE_USAGE_CRITICAL"
View Source
const A008_SPACE_USAGE_NORMAL string = "A008_SPACE_USAGE_NORMAL"
View Source
const A008_SPACE_USAGE_WARNING string = "A008_SPACE_USAGE_WARNING"

Case codes

View Source
const MSG_NETWORK_FS_CONCLUSION_1 string = "" /* 172-byte string literal not displayed */
View Source
const MSG_NETWORK_FS_CONCLUSION_N string = "" /* 171-byte string literal not displayed */
View Source
const MSG_NETWORK_FS_RECOMMENDATION string = "[P1] Never use NFS to run Postgres."
View Source
const MSG_NOT_RECOMMENDED_FS_CONCLUSION_1 string = "" /* 249-byte string literal not displayed */
View Source
const MSG_NOT_RECOMMENDED_FS_CONCLUSION_N string = "" /* 266-byte string literal not displayed */
View Source
const MSG_NOT_RECOMMENDED_FS_RECOMMENDATION string = "[P3] Consider using [ext4](https://en.wikipedia.org/wiki/Ext4) for all Postgres directories."
View Source
const MSG_NO_USAGE_RISKS_CONCLUSION string = "Risks of running out of free disk space in the nearest future are low."
View Source
const MSG_USAGE_CRITICAL_CONCLUSION string = "[P1] `%s` on machine `%s` has %s of space used, it exceeds 90%%. Risks of running out of free disk space in the nearest future are high. " +
	"If it happens, PostgreSQL shuts down and a manual fix is required."
View Source
const MSG_USAGE_CRITICAL_RECOMMENDATION string = "[P1] Increase free space on `%s` on machine `%s` as soon as possible to prevent service outage."
View Source
const MSG_USAGE_WARNING_CONCLUSION string = "" /* 144-byte string literal not displayed */
View Source
const MSG_USAGE_WARNING_RECOMMENDATION string = "[P2] Increase free space on `%s` on machine `%s`. It is recommended to keep more than %d%% disk space free " +
	"to reduce risks of running out of free disk space."
View Source
const USAGE_CRITICAL int = 90
View Source
const USAGE_WARNING int = 70

Variables

View Source
var FS_RECOMMENDED []string = []string{
	"ext4",
	"xfs",
	"tmpfs",
}

Functions

func A008PreprocessReportData

func A008PreprocessReportData(data map[string]interface{})

func A008Process

func A008Process(report A008Report) checkup.ReportResult

Generate conclusions and recommendatons

Types

type A008Report

type A008Report struct {
	Project       string                  `json:"project"`
	Name          string                  `json:"name"`
	CheckId       string                  `json:"checkId"`
	Timestamptz   string                  `json:"timestamptz"`
	Database      string                  `json:"database"`
	Dependencies  map[string]interface{}  `json:"dependencies"`
	LastNodesJson checkup.ReportLastNodes `json:"last_nodes_json"`
	Results       A008ReportHostsResults  `json:"results"`
}

type A008ReportHostResult

type A008ReportHostResult struct {
	Data      A008ReportHostResultData `json:"data"`
	NodesJson checkup.ReportLastNodes  `json:"nodes.json"`
}

type A008ReportHostResultData

type A008ReportHostResultData struct {
	DbData map[string]FsItem `json:"data"`
	FsData map[string]FsItem `json:"fs_data"`
}

type A008ReportHostsResults

type A008ReportHostsResults map[string]A008ReportHostResult

type FsItem

type FsItem struct {
	Fstype     string `json:"fstype"`
	Size       string `json:"size"`
	Avail      string `json:"avail"`
	Used       string `json:"used"`
	UsePercent string `json:"use_percent"`
	MountPoint string `json:"mount_point"`
	Path       string `json:"path"`
	Device     string `json:"device"`
}

Jump to

Keyboard shortcuts

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