Table of Contents

Name

knoerred - experimental udp server for nagios remote checks

Synopsis

knoerred listenport allowedclientaddress [ allowedclientaddress ] ...

Description

knoerred is a UDP server for nagios remote monitoring. Like its brother knoerre it has a small footprint and is very fast. Unlike knoerre which is designed to be used with DJB’s tcpserver (or other super-daemons) knoerred runs as standalone non-forking-daemon. It waits for one packet with a request and sends one packet back. The key-request sent to knoerred must be terminated by a LF.
knoerred listens on all local addresses on the specified port. As a second argument the IP address of a allowed client host must be specified. Up to 19 optional addresses may be given.

knoerred has more limits than knoerre but it may run 5 to 20 times faster. It does not support calling an external program or script like knoerre does. Currently only a few checks/keys are built in:
load1 load5 load15 cat cmdline cmp diskinodes diskusage filetimestamp proccount proccounttg process processd swaps timediff wc-l loadmulti
Please look at knoerre(1) for description of the keys.
loadmulti is a collection of some checks in a single request:
cpuI cpus cpuu cpuw ctxt diskinodes/ diskusage/ hostname load1 load15 load5

netlinksdown nettraf0 nettraf1 proccount swaps timediff

For every request sent knoerred uses only 3 syscalls to sent the results back (only a kernel module would be faster). If a file /nagios-cache/multiresults exists then its contents with up to 966 bytes will be included in the packet sent back.

Examples


What’s the load per one minute average on the remote server running knoerred?

$ echo load1 |nc -w 1 -u 127.0.0.1 8888
0.00 0.00 0.02 2/250 19914
0.00
$ time check_remote_by_udp -w 7 -c 30 -H 127.0.0.1 -p 8888 -t 1 load1
REMOTE OK - 3.68 | load1=3.68;7;30


real 0m0.002s
user 0m0.000s
sys 0m0.000s

The following example uses netcat to show the results of a loadmulti check, including check of hostname and systime:

$ echo loadmulti/$(date +%s)/gway |nc -w 1 -u 127.0.0.1 8888
hostname

0
timediff

0
cpuu u0s0w0

0
cpus u0s0w0

0
cpuw u0s0w0

0
cpuI u0s0w0

1
ctxt

70
nettraf0

0
nettraf1

0
swaps

2
diskusage/ 0GB free

84
diskinodes/ 47205 free

61
netlinksdown lo,eth0,eth1

0
load5

0.00
load15

0.00
proccount

138
load1

0.00 0.00 0.00 3/138 21264
0.00

Caveats

knoerred does only send one single udp packet with up to approx. 1.5 KB back where all results must fit in.
knoerred does always run in foreground. You must use something like daemonize of the sac-tools package to run it as daemon but the usage of DJBs daemontools is strongly recommended.

See Also

knoerre(1) , check_remote_by_udp_multi(1) , check_remote_by_udp(1) , check_remote_by_http(1)
http://downloads.tuxad.de/nagios-fwb

http://cr.yp.to/daemontools.html

Author

Frank Bergmann, http://www.tuxad.com


Table of Contents