Skip to content

Sneck

This is for replacing Nagios/Icinga or the LibreNMS service integration in regards to NRPE. This allows LibreNMS to query what checks were ran on the server and keep track of totals of OK, WARNING, CRITICAL, and UNKNOWN statuses.

The big advantage over this compared to a NRPE are as below.

  • It does not need to know what checks are configured on it.
  • Also does not need to wait for the tests to run as sneck is meant to be ran via cron and the then return the cache when queried via SNMP, meaning a lot faster response time, especially if slow checks are being performed.
  • Works over proxied SNMP connections.

Included are alert examples. Although for setting up custom ones, the metrics below are provided.

Metric Description
ok Total OK checks
warning Total WARNING checks
critical Total CRITICAL checks
unknown Total UNKNOWN checks
errored Total checks that errored
time_to_polling Difference in seconds between when polling data was generated and when polled
time_to_polling_abs The absolute value of time_to_polling.
check_$CHECK Exit status of a specific check $CHECK is equal to the name of the check in question. So foo gives check_foo

The standard Nagios/Icinga style exit codes are used and those are as below.

Exit Meaning
0 okay
1 warning
2 critical
3+ unknown

To use time_to_polling, enable it. Set the config item below. The default is false. Unless set to true, this value defaults to 0. With this option on, run NTP on every host. Without NTP, the check alerts above a difference of 540s.

lnms config:set app.sneck.polling_time_diff true

For more information on Sneck, check it out at MetaCPAN or Github.

For poking systems using Sneck, also check out boop_snoot if one wants to query those systems via the CLI. Docs on it at MetaCPAN and Github.

Install prerequisites

apt-get install cpanminus libjson-perl libfile-slurp-perl libmime-base64-perl
cpanm Monitoring::Sneck
pkg install p5-JSON p5-File-Slurp p5-MIME-Base64 p5-App-cpanminus
cpanm Monitoring::Sneck
cpanm Monitoring::Sneck

SNMP Extend

  1. Configure any of the checks you want to run in /usr/local/etc/sneck.conf. You con find it documented here.

  2. Add it to cron. You then do not wait for all the checks to complete when polled via SNMP, which for like SMART or another long check. These checks cause a timeout. This method also does not need called via sudo as well.

    */5 * * * * /usr/bin/env PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin /usr/local/bin/sneck -u 2> /dev/null > /dev/null
    
  3. Set it up in the snmpd config and restart snmpd. If calling sneck -c instead or catting the non-snmp cache file, there is the possibility of snmpd mangling the return. To avoid this cat the snmp cache file as below or call sneck -c -b.

    extend sneck /bin/cat /var/cache/sneck.cache.snmp
    
  4. In LibreNMS, enable the application for the server in question or wait for auto discovery to find it.