monit

package
v1.20.2 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2021 License: MIT Imports: 9 Imported by: 0

README

Monit Input Plugin

The monit plugin gathers metrics and status information about local processes, remote hosts, file, file systems, directories and network interfaces managed and watched over by Monit.

The use this plugin you should first enable the HTTPD TCP port in Monit.

Minimum Version of Monit tested with is 5.16.

Configuration
[[inputs.monit]]
  ## Monit HTTPD address
  address = "http://127.0.0.1:2812"

  ## Username and Password for Monit
  # username = ""
  # password = ""

  ## Amount of time allowed to complete the HTTP request
  # timeout = "5s"

  ## Optional TLS Config
  # tls_ca = "/etc/telegraf/ca.pem"
  # tls_cert = "/etc/telegraf/cert.pem"
  # tls_key = "/etc/telegraf/key.pem"
  ## Use TLS but skip chain & host verification
  # insecure_skip_verify = false
Metrics
  • monit_filesystem
    • tags:
      • address
      • version
      • service
      • platform_name
      • status
      • monitoring_status
      • monitoring_mode
    • fields:
      • status_code
      • monitoring_status_code
      • monitoring_mode_code
      • mode
      • block_percent
      • block_usage
      • block_total
      • inode_percent
      • inode_usage
      • inode_total
  • monit_directory
    • tags:
      • address
      • version
      • service
      • platform_name
      • status
      • monitoring_status
      • monitoring_mode
    • fields:
      • status_code
      • monitoring_status_code
      • monitoring_mode_code
      • permissions
  • monit_file
    • tags:
      • address
      • version
      • service
      • platform_name
      • status
      • monitoring_status
      • monitoring_mode
    • fields:
      • status_code
      • monitoring_status_code
      • monitoring_mode_code
      • size
      • permissions
  • monit_process
    • tags:
      • address
      • version
      • service
      • platform_name
      • status
      • monitoring_status
      • monitoring_mode
    • fields:
      • status_code
      • monitoring_status_code
      • monitoring_mode_code
      • cpu_percent
      • cpu_percent_total
      • mem_kb
      • mem_kb_total
      • mem_percent
      • mem_percent_total
      • pid
      • parent_pid
      • threads
      • children
  • monit_remote_host
    • tags:
      • address
      • version
      • service
      • platform_name
      • status
      • monitoring_status
      • monitoring_mode
    • fields:
      • status_code
      • monitoring_status_code
      • monitoring_mode_code
      • hostname
      • port_number
      • request
      • response_time
      • protocol
      • type
  • monit_system
    • tags:
      • address
      • version
      • service
      • platform_name
      • status
      • monitoring_status
      • monitoring_mode
    • fields:
      • status_code
      • monitoring_status_code
      • monitoring_mode_code
      • cpu_system
      • cpu_user
      • cpu_wait
      • cpu_load_avg_1m
      • cpu_load_avg_5m
      • cpu_load_avg_15m
      • mem_kb
      • mem_percent
      • swap_kb
      • swap_percent
  • monit_fifo
    • tags:
      • address
      • version
      • service
      • platform_name
      • status
      • monitoring_status
      • monitoring_mode
    • fields:
      • status_code
      • monitoring_status_code
      • monitoring_mode_code
      • permissions
  • monit_program
    • tags:
      • address
      • version
      • service
      • platform_name
      • status
      • monitoring_status
      • monitoring_mode
    • fields:
      • status_code
      • monitoring_status_code
      • monitoring_mode_code
  • monit_network
    • tags:
      • address
      • version
      • service
      • platform_name
      • status
      • monitoring_status
      • monitoring_mode
    • fields:
      • status_code
      • monitoring_status_code
      • monitoring_mode_code
  • monit_program
    • tags:
      • address
      • version
      • service
      • platform_name
      • status
      • monitoring_status
      • monitoring_mode
    • fields:
      • status_code
      • monitoring_status_code
      • monitoring_mode_code
  • monit_network
    • tags:
      • address
      • version
      • service
      • platform_name
      • status
      • monitoring_status
      • monitoring_mode
    • fields:
      • status_code
      • monitoring_status_code
      • monitoring_mode_code
Example Output
monit_file,monitoring_mode=active,monitoring_status=monitored,pending_action=none,platform_name=Linux,service=rsyslog_pid,source=xyzzy.local,status=running,version=5.20.0 mode=644i,monitoring_mode_code=0i,monitoring_status_code=1i,pending_action_code=0i,size=3i,status_code=0i 1579735047000000000
monit_process,monitoring_mode=active,monitoring_status=monitored,pending_action=none,platform_name=Linux,service=rsyslog,source=xyzzy.local,status=running,version=5.20.0 children=0i,cpu_percent=0,cpu_percent_total=0,mem_kb=3148i,mem_kb_total=3148i,mem_percent=0.2,mem_percent_total=0.2,monitoring_mode_code=0i,monitoring_status_code=1i,parent_pid=1i,pending_action_code=0i,pid=318i,status_code=0i,threads=4i 1579735047000000000
monit_program,monitoring_mode=active,monitoring_status=initializing,pending_action=none,platform_name=Linux,service=echo,source=xyzzy.local,status=running,version=5.20.0 monitoring_mode_code=0i,monitoring_status_code=2i,pending_action_code=0i,program_started=0i,program_status=0i,status_code=0i 1579735047000000000
monit_system,monitoring_mode=active,monitoring_status=monitored,pending_action=none,platform_name=Linux,service=debian-stretch-monit.virt,source=xyzzy.local,status=running,version=5.20.0 cpu_load_avg_15m=0,cpu_load_avg_1m=0,cpu_load_avg_5m=0,cpu_system=0,cpu_user=0,cpu_wait=0,mem_kb=42852i,mem_percent=2.1,monitoring_mode_code=0i,monitoring_status_code=1i,pending_action_code=0i,status_code=0i,swap_kb=0,swap_percent=0 1579735047000000000
monit_remote_host,dc=new-12,host=palladium,monitoring_mode=active,monitoring_status=monitored,pending_action=none,platform_name=Linux,rack=rack-0,service=blog.kalvad.com,source=palladium,status=running,version=5.27.0 monitoring_status_code=1i,monitoring_mode_code=0i,response_time=0.664412,type="TCP",pending_action_code=0i,remote_hostname="blog.kalvad.com",port_number=443i,request="/",protocol="HTTP",status_code=0i 1599138990000000000

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	Percent float64 `xml:"percent"`
	Usage   float64 `xml:"usage"`
	Total   float64 `xml:"total"`
}

type CPU

type CPU struct {
	Percent      float64 `xml:"percent"`
	PercentTotal float64 `xml:"percenttotal"`
}

type Download

type Download struct {
	Packets struct {
		Now   int64 `xml:"now"`
		Total int64 `xml:"total"`
	} `xml:"packets"`
	Bytes struct {
		Now   int64 `xml:"now"`
		Total int64 `xml:"total"`
	} `xml:"bytes"`
	Errors struct {
		Now   int64 `xml:"now"`
		Total int64 `xml:"total"`
	} `xml:"errors"`
}

type Inode

type Inode struct {
	Percent float64 `xml:"percent"`
	Usage   float64 `xml:"usage"`
	Total   float64 `xml:"total"`
}
type Link struct {
	State    int      `xml:"state"`
	Speed    int64    `xml:"speed"`
	Duplex   int      `xml:"duplex"`
	Download Download `xml:"download"`
	Upload   Upload   `xml:"upload"`
}

type Memory

type Memory struct {
	Percent       float64 `xml:"percent"`
	PercentTotal  float64 `xml:"percenttotal"`
	Kilobyte      int64   `xml:"kilobyte"`
	KilobyteTotal int64   `xml:"kilobytetotal"`
}

type Messagebody

type Messagebody struct {
	Metrics []string `json:"metrics"`
}

type Monit

type Monit struct {
	Address  string `toml:"address"`
	Username string `toml:"username"`
	Password string `toml:"password"`

	tls.ClientConfig
	Timeout config.Duration `toml:"timeout"`
	// contains filtered or unexported fields
}

func (*Monit) Description

func (m *Monit) Description() string

func (*Monit) Gather

func (m *Monit) Gather(acc telegraf.Accumulator) error

func (*Monit) Init

func (m *Monit) Init() error

func (*Monit) SampleConfig

func (m *Monit) SampleConfig() string

type Platform

type Platform struct {
	Name    string `xml:"name"`
	Release string `xml:"release"`
	Version string `xml:"version"`
	Machine string `xml:"machine"`
	CPU     int    `xml:"cpu"`
	Memory  int    `xml:"memory"`
	Swap    int    `xml:"swap"`
}

type Port

type Port struct {
	Hostname     string  `xml:"hostname"`
	PortNumber   int64   `xml:"portnumber"`
	Request      string  `xml:"request"`
	ResponseTime float64 `xml:"responsetime"`
	Protocol     string  `xml:"protocol"`
	Type         string  `xml:"type"`
}

type Program

type Program struct {
	Started int64 `xml:"started"`
	Status  int   `xml:"status"`
}

type Server

type Server struct {
	ID            string `xml:"id"`
	Version       string `xml:"version"`
	Uptime        int64  `xml:"uptime"`
	Poll          int    `xml:"poll"`
	LocalHostname string `xml:"localhostname"`
	StartDelay    int    `xml:"startdelay"`
	ControlFile   string `xml:"controlfile"`
}

type Service

type Service struct {
	Type             string  `xml:"type,attr"`
	Name             string  `xml:"name"`
	Status           int     `xml:"status"`
	MonitoringStatus int     `xml:"monitor"`
	MonitorMode      int     `xml:"monitormode"`
	PendingAction    int     `xml:"pendingaction"`
	Memory           Memory  `xml:"memory"`
	CPU              CPU     `xml:"cpu"`
	System           System  `xml:"system"`
	Size             int64   `xml:"size"`
	Mode             int     `xml:"mode"`
	Program          Program `xml:"program"`
	Block            Block   `xml:"block"`
	Inode            Inode   `xml:"inode"`
	Pid              int64   `xml:"pid"`
	ParentPid        int64   `xml:"ppid"`
	Threads          int     `xml:"threads"`
	Children         int     `xml:"children"`
	Port             Port    `xml:"port"`
	Link             Link    `xml:"link"`
}

type Status

type Status struct {
	Server   Server    `xml:"server"`
	Platform Platform  `xml:"platform"`
	Services []Service `xml:"service"`
}

type System

type System struct {
	Load struct {
		Avg01 float64 `xml:"avg01"`
		Avg05 float64 `xml:"avg05"`
		Avg15 float64 `xml:"avg15"`
	} `xml:"load"`
	CPU struct {
		User   float64 `xml:"user"`
		System float64 `xml:"system"`
		Wait   float64 `xml:"wait"`
	} `xml:"cpu"`
	Memory struct {
		Percent  float64 `xml:"percent"`
		Kilobyte int64   `xml:"kilobyte"`
	} `xml:"memory"`
	Swap struct {
		Percent  float64 `xml:"percent"`
		Kilobyte float64 `xml:"kilobyte"`
	} `xml:"swap"`
}

type Upload

type Upload struct {
	Packets struct {
		Now   int64 `xml:"now"`
		Total int64 `xml:"total"`
	} `xml:"packets"`
	Bytes struct {
		Now   int64 `xml:"now"`
		Total int64 `xml:"total"`
	} `xml:"bytes"`
	Errors struct {
		Now   int64 `xml:"now"`
		Total int64 `xml:"total"`
	} `xml:"errors"`
}

Jump to

Keyboard shortcuts

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