Translations of this page:

How to monitor clients which are not up all the time?

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.


  • Printers, which should be monitored for toner and paper
  • Windows clients, which patch level should be supervised
  • Salesmans notebooks, which are not connected most of the time.
    But if they are, we want to check all we can get of them.

Offline devices

The basic principle is really simple:

  1. When a device is offline, say OK and print a message “It's offline”
  2. When it's available, check it and treat it as an normal device.

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


Enter your comment
blog/2009/how_to_monitor_clients_which_are_not_up_all_the_time.txt · Last modified: 2015/10/12 16:19 by flackem = chi`s home Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0