Nagios Notifications - Information Missing


#1

I’m having a frustrating problem which I hope you can help solve.

I’ve got the following service command set up:

define command{
command_name notify-by-epager
command_line curl “http://127.0.0.1:13004/cgi-bin/sendsms?username=simple&password=simple&to=$CONTACTPAGER$&text=$NOTIFICATIONTYPE$:+$HOSTALIAS$/$SERVICEDESC$+is+$SERVICESTATE$
}

The curl command calls a SMS gateway we set up on the Nagios server and is tested and working.

This works fine when the host comes up and reports:

RECOVERY: MyServer/PING is OK

When the service goes down, however, some of the variables are missing resulting in a message like the following:

PROBLEM: MyServer/ is

The $SERVICEDESC$ and $SERVICESTATE$ variables just don’t show up for the party.

Any ideas?

Thanks in advance.


#2

Hi!

I’m not sure, but it seems that you’re confusing services tests and hosts tests.
In fact, when you have your problem: is it the service that goes down, or the host ?

if it is the host, the $SERVICEDESC$ and $SERVICESTATE$ variables will be, of course, empty
(if it really is the service … well, I don’t know how to help you :/)


#3

Thanks for the response. It was a service that was going down (info missing in the notification) then coming up again (all info there) - very strange.

I have done this whole thing another way round now, but I still have no idea what the problem was as I think it should have worked.