NAME
sneck - a boopable LibreNMS JSON style SNMP extend for remotely running nagios style checks akin to NRPE
SYNOPSIS
sneck -u [-C <cache file>] [-f <config file>] [-p] [-i] [-d] [-q] [-l|-L] [-P <pid dir>] [-r] [-T <seconds>] [-s <signal>] [-k|-K]
sneck -c [-C <cache file>] [-f <config file>] [-b]
sneck [-f <config file>] [-p] [-i] [-r] [-T <seconds>] [-s <signal>] [-k|-K]
sneck -t [-f <config file>]
DESCRIPTION
For a description of the config file format and output, please see Monitoring::Sneck.
The cache file, PID dir, locking, and check timeout settings may also be set in the config file. Flags override those. See OPTIONS in Monitoring::Sneck::Config.
FLAGS
-f <config file>
The config file to use.
Files ending in .yaml or .yml are read as YAML, which needs YAML::XS. See Monitoring::Sneck::Config for both formats.
Default :: /usr/local/etc/sneck.conf
-p
Pretty it in a nicely formatted format.
-C <cache file>
The cache file to use.
Overrides cache_file in the config.
Default :: /var/cache/sneck.cache
A secondary cache file based on this name is also created. By default it is /var/cache/sneck.cache.snmp and always holds the GZip+BASE64 compressed version.
-u
Update the cache file. Will also print the was written to it.
-c
Print the cache file. Please note that -p or -i won't affect this as this flag only reads/prints the cache file.
-b
When used with -c, print the LibreNMS style GZip+BASE64 compressed cache instead.
-i
Includes the config file used.
-d
Print debugging info if called with -u.
-q
Don't print the results for -u. Exit queitly.
-l
Enable locking for with -u so more than one instance can't run at a time. Overrides locking in the config.
The PID file is sneck.pid in the directory set by -P.
-L
Disable locking, overriding locking in the config. Can not be used with -l.
-P <pid dir>
The directory for the PID file used by -l. The user running sneck must be able to write to it.
Overrides pid_dir in the config.
Default :: /var/run
-r
Run any restarts whose checks failed. Without this, restarts are only reported as 'restarts disabled'. Meant to be used with -u from cron. Never use it from snmpd.
Restart state, used for min_interval and max_retries, is kept in the cache file name with '.restarts' added, so by default /var/cache/sneck.cache.restarts.
Use locking with this to make sure two runs can't restart things at the same time. Without it, a warning saying so is printed to stderr.
See Monitoring::Sneck::Config for how restarts are configured.
-T <seconds>
Seconds to wait on each check before giving up on it. Overrides check_timeout in the config.
Default :: 30
-s <signal>
Signal to send a check on timeout, such as TERM. Overrides check_timeout_signal in the config. 'none' sends no signal, even if the config sets one.
Default :: none
-k
Also send the timeout signal to all child processes of a check. Overrides check_kill_sub_pids in the config. Does nothing without a timeout signal. This is the default.
-K
Do not send the timeout signal to child processes of a check. Overrides check_kill_sub_pids in the config. Can not be used with -k.
-t
Test the config file. Prints any errors and warnings, then exits 0 if there are no errors and 1 if there are or the file can't be read. Warnings, such as a check using a undefined variable, do not affect the exit code.