Problem with email alerts

hey, i have been noticing that instead of having pages that say exactly what is going on, i just get an “UP” page with a “PROBLEM” but it does not say what the problem is.

For example today when I came in one of the servers had a drive that was almost at capacity. Instead of getting a message saying that the disk was at 99% I got a page that says:

Subject: Host UP alert for tflserver!
Date: Tue, 14 Mar 2006 07:48:19 -0600 (CST)

***** Nagios *****

Notification Type: PROBLEM
Host: tflserver
State: UP
Address: 192.168.100.2
Info: PING OK - Packet loss = 0%, RTA = 0.25 ms

Date/Time: Tue Mar 14 07:48:19 CST 2006

anyone have any idea why this might be happening?

did you possibly play around with the notify by email command?

Luca

You know what? i actually use nagiosQL 2005. It would seem that I just left the Event handler blank. I changed it to notify-by-email. I bet that fixes it. Thanks!

Hmm… Fixed that and still having the same problem. I am using a monitored service instead of the disk now because I can stop it to test if the notification is working proper

Perhaps, as Luca suggested, there’s something wrong with your notify-by-email command. You could try posting it here and letting us have a look at it. However, I would guess there’s something more to your problem, since you should just be using macros to define your e-mail notification ($HOSTSTATE$, $SERVICEOUTPUT$, etc.).

Here is my notify by email command-

‘notify-by-email’ command definition

define command{
command_name notify-by-email
command_line /usr/bin/printf “%b” “***** Nagios ***\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /usr/bin/mail -s " $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **” $CONTACTEMAIL$
}

looks normal enough, right? its the stock notify by email command…

are you always getting those UP notifications instead of the real problem notification?
check the notificaitons page to see what has been sent out.

Luca

No, I also get down alerts… It seems like the only alert that is working is the check_ping plugin as far as notifacations are concerned. But for example if a disk gets twards full or a service stops, I still get a notifacation, but it just says host up and “PROBLEM”…

(sorry about the long pause here, was out sick for a couple days)

Thanks Jakkedup-

My problem was that I was using the event handler to notify. Got confused / lazy per nagiosQL :?

Sorry :frowning:

Thanks for checking everyone!

evidently you got the answer from another forum post, since I don’t see my suggestion in this one. But yea, the first thing I was going to say was “why are you using an eventhandler for a notification?” hehe