The Nagios world consists of hosts and services. But what to do if the hosts do not matter? This is the case with all devices which are not necessarily up all the time, but have services need to be monitored if they are.
E.g.
The basic principle is really simple:
This can be implemented using the following check_multi snippet:
# # check_client.cmd # 08.02.2009 # # (c) Matthias Flacke # # Call: check_multi -f check_client.cmd -s HOSTNAME=<host> command [ ping ] = check_icmp -H $HOSTNAME$ -w 500,5% -c 1000,10% eval [ offline ] = if ($STATE_ping$ != $OK) { print "Host offline"; exit 0; } # execute these commands only if host online command [ command1 ] = ... command [ command2 ] = ...
The trick happens in the eval line: if the ping in the command line before does not succeed, we don't bother any more about this client, pring a short message “Host offline” and exit with OK.
Note: The eval command will not be shown in the normal visualization.
That's all.
BTW - users reported, that it's quite a miracle when during the late afternoon all clients problems disappeared silently host per host until everything is green
The idea stems from this thread in the German Monitoring Portal
Comments