Monitoring::Sneck::Checks

Nagios style checks written in Perl, run in process by sneck instead of as a program per check.

www|perl:http -H www.example.org -S -w 1 -c 2 -s Welcome
www_cert|perl:https_cert -H www.example.org -w 30 -c 14
dns_www|perl:dns -H www.example.org -a 192.0.2.10
backup_age|perl:file_age -f /var/backups/db.sql.gz -w 90000 -c 180000

They can also be run from the shell, or used as a nagios plugin, via sneck_check. --list-checks lists them and --help with a check prints its docs.

sneck_check http -H www.example.org -S -w 1 -c 2
sneck_check --help http
sneck_check --list-checks

Checks

Those that look at the host, such as disk, interface, listening, and sysctl, work on Linux and FreeBSD, except neighbors, oom, pressure, and systemd_failed, which are Linux only, as is procs with --fd-warning or --fd-critical, debsecan, which is Debian only, and jails and pkg_audit, which are FreeBSD only.

Each check's POD lists its options, such as perldoc Monitoring::Sneck::Checks::http.

Return Codes

Codes are the nagios ones, 0 to 3, except for -1, which means the check could not be loaded. That is what a bad name, base, a module that is not there, or one that is not a Monitoring::Sneck::Checks::base gets. Bad args, timing out, and the check dying are UNKNOWN.

Writing Checks

A check is a module named Monitoring::Sneck::Checks::$name that subclasses Monitoring::Sneck::Checks::base, which has the shared helpers, such as option parsing, nagios style ranges, perfdata, and setting up LWP and Net::DNS with the timeout. See its POD.

Install

From Source

perl Makefile.PL
make
make test
make install

FreeBSD

pkg install p5-libwww p5-LWP-Protocol-https p5-HTTP-Message p5-Net-DNS p5-Net-IP \
    p5-Data-Validate-Domain p5-Data-Validate-IP p5-File-Slurp p5-XML-LibXML \
    p5-IO-Socket-SSL p5-Net-SSLeay p5-IO-Socket-IP p5-JSON p5-JSON-XS p5-Filesys-Df \
    p5-Proc-ProcessTable p5-BSD-Sysctl

Then install from source as above.

Debian

apt-get install libwww-perl liblwp-protocol-https-perl libhttp-message-perl libnet-dns-perl \
    libnet-ip-perl libdata-validate-domain-perl libdata-validate-ip-perl libfile-slurp-perl \
    libxml-libxml-perl libio-socket-ssl-perl libnet-ssleay-perl libjson-perl libjson-xs-perl libfilesys-df-perl \
    libproc-processtable-perl

Then install from source as above.