Skip to content

Metric plugins - mackerel-plugin-linux

mackerel-plugin-linux is a plugin that aggregates Linux information every minute and posts it as a metric.

Monitorable metrics

Linux Users

Metric Display NameMetric NameDiffStackedDescription
Userslinux.users.usersNumber of logged-in users

Post the number of users resulting from the who command.

Linux Interrupts

Metric Display NameMetric NameDiffStackedDescription
Interruptslinux.interrupts.interruptsNumber of interrupts generated by the system

Post the value of intr in /proc/stat.

Linux Context Switches

Metric Display NameMetric NameDiffStackedDescription
Context Switcheslinux.context_switches.context_switchesNumber of context switches

Post the value of ctxt in /proc/stat.

Linux Forks

Metric Display NameMetric NameDiffStackedDescription
Forkslinux.forks.forksNumber of forks

Post the value of processes in /proc/stat.

Disk Elapsed IO Time

Metric Display NameMetric NameDiffStackedDescription
<device> IO Timelinux.disk.elapsed.iotime_<device>Total time this block device has been active (ms)
<device> IO Time Weightedlinux.disk.elapsed.iotime_weighted_<device>Total waiting time for all requests (ms)

Post io_ticks and time_in_queue values in /sys/block/<device>/stat. <device> is replaced by the device name.

Disk Read/Write Time

Metric Display NameMetric NameDiffStackedDescription
<device> Readlinux.disk.rwtime.tsreading_<device>Total waiting time for read requests (ms)
<device> Writelinux.disk.rwtime.tswriting_<device>Total wait time for write requests (ms)

Post values of read ticks and write ticks in /sys/block/<device>/stat. <device> is replaced by the device name.

Linux Network Connection States

Metric Display NameMetric NameDiffStackedDescription
Establishedlinux.ss.ESTABNumber of ESTAB
Syn Sentlinux.ss.SYN-SENTNumber of SYN-SENT
Syn Receivedlinux.ss.SYN-RECVNumber of SYN-RECV
Fin Wait 1linux.ss.FIN-WAIT-1Number of FIN-WAIT-1
Fin Wait 2linux.ss.FIN-WAIT-2Number of FIN-WAIT-2
Time Waitlinux.ss.TIME-WAITNumber of TIME-WAIT
Closelinux.ss.UNCONNNumber of UNCONN
Close Waitlinux.ss.CLOSE-WAITNumber of CLOSE-WAIT
Last Acklinux.ss.LAST-ACKNumber of LAST-ACK
Listenlinux.ss.LISTENNumber of LISTEN
Closinglinux.ss.CLOSINGNumber of CLOSING
Unknownlinux.ss.UNKNOWNNumber of UNKNOWN

Post the number of ss command results counted by State.

Linux Swap Usage

Metric Display NameMetric NameDiffStackedDescription
Swap Inlinux.swap.pswpinNumber of pages swap in
Swap Outlinux.swap.pswpoutNumber of pages swap out

Post pswpin and pswpout values in /proc/vmstat.

Configurable options

OptionShortDescriptionDefault
--tempfile-tSpecify the destination file path for tempfile
--type-pFilter the metrics to be retrieve
Choose all, users, proc_stat, diskstats, netstat, or swap
all
--version-vShow the plugin version
--help-hShow Help

The tempfile contains the aggregated results. By default, it is created under /var/tmp/mackerel-agent/ as mackerel-plugin-linux-<hash string>.

Example configuration

toml
[plugin.metrics.linux]
command = ["mackerel-plugin-linux"]

Repository

[https://github.com/mackerelio/mackerel-agent-plugins/tree/master/mackerel-plugin-linux]