Empty State field in notificaions


i found a strange problem

when one of the host seems to be down and check_ping returns CRITICAL alert and when notification about this problem arrived it has an empty state field:

***** Nagios *****

Notification Type: PROBLEM

Host: Citrix

Date/Time: Wed Jan 16 10:56:27 MSK 2008

Additional Info:

define host{
use generic-host ; Name of host template to use
host_name citrix_90
alias Citrix
address XX.XX.XX.90

define service{
use generic-service ; Name of service template to use
host_name citrix_90
service_description PING
check_command check_ping!250.0,20%!500.0,60%

BTW, other critical services problems like fail to check disk usage via snmp or fail to check tcp port always return States correctly in notifications.


Here may be the explanation of the problem:

the alert you’re seeing does not come from the service PING, but it comes from the host check.
In fact, by using “generic-host”, you’ll see that in the host template, there’s a check_command defined as check_ping

which means that when the service PING goes down, the host is checked, found KO, and the notification is sent as a HOST_DOWN.

In the end, if you have a look at your command definition, you may see that you’re expecting SERVICESTATE, whereas you get a HOSTSTATE instead.

To solve this problem, you might want to use a virtual_host (with the passive_checks_enabled line set to 0), or add a HOSTSTATE in your notification command.

I hope this was clear enough; don’t hesitate to ask if you have problems :slight_smile:
(I also hope I found the real source of your problem ;))