Monitors: Difference between revisions
(Created page with "=== Local Tests === ==== Filesystems and Storage ==== btrfs.monitor - BTRFS filesystems softraid.monitor - Linux Software RAID zfs.monitor - ZFS filesystems [...") |
(How to write monitor scripts) |
||
Line 1: | Line 1: | ||
=== How to Write a Monitor Script === | |||
A monitor script will take some command-line parameters specifying what to test, it will return 1 if there is a failure or 0 if everything is OK. | |||
The first line of output is the "summary" that will be shown when you run "monshow" and further lines will be the details. | |||
When things go OK the "summary" line should briefly report any useful information, such as an indication of when the test might fail in future. So a test for certificate expiry should report the next time a certificate will expire even when it's far enough in the future to not be an error. A test for disk space should report the amount of free space even when that's OK. | |||
A monitor script that tests network things should be in the mon.d directory. A script that does local tests (which doesn't mean network tests to localhost) should be in mon-local.d. SE Linux and other security systems will give different permissions to scripts in mon-local.d. | |||
=== Local Tests === | === Local Tests === | ||
Latest revision as of 05:52, 4 September 2017
How to Write a Monitor Script
A monitor script will take some command-line parameters specifying what to test, it will return 1 if there is a failure or 0 if everything is OK.
The first line of output is the "summary" that will be shown when you run "monshow" and further lines will be the details.
When things go OK the "summary" line should briefly report any useful information, such as an indication of when the test might fail in future. So a test for certificate expiry should report the next time a certificate will expire even when it's far enough in the future to not be an error. A test for disk space should report the amount of free space even when that's OK.
A monitor script that tests network things should be in the mon.d directory. A script that does local tests (which doesn't mean network tests to localhost) should be in mon-local.d. SE Linux and other security systems will give different permissions to scripts in mon-local.d.
Local Tests
Filesystems and Storage
btrfs.monitor - BTRFS filesystems
softraid.monitor - Linux Software RAID
zfs.monitor - ZFS filesystems
freespace.monitor - free space
Others
linux-temp.monitor - Linux system Temperature
loadavg.monitor - Unix load average
ps.monitor - Unix processes
Remote Tests
I've added stub links for all the monitor scripts currently included. Some of them may not be suitable going forward, EG I really doubt that we need 2 ping tests, 3 smtp tests, and 2 imap tests. Also some of them probably should be in the local section (maybe dialin). Finally some of them may be unsupportable, if a test doesn't appear to work, I can't test it, and I can't find someone to take ownership of it then I will consider removing it.