Host check action alert issue

Arno Lehmann al at its-lehmann.de
Fri May 26 23:57:27 CEST 2006


Hello,

On 5/26/2006 11:41 PM, Oliver Marshall wrote:
> Does anyone else have problems with email notifications generated by the
> check_command param generated by host failures, particularly the
> check-host-alive command ?
> 
> I have the check_command for each host set to check-host-alive. If any
> of the hosts goes offline, and fails the check-host-alive check, I get
> this email;
> 
> Subject: ** PROBLEM alert - My laptop/ is  **
> ***** Nagios  *****
> Notification Type: PROBLEM
> 
> Service: 
> Host: My laptop
> Address: 192.168.100.241
> State: 
> 
> Date/Time: Fri May 26 22:38:07 BST 2006
> 
> Additional Info:
> 
> 
> The 'notify-by-email' command that I am using to send out the email
> notifications is as follows.

look at the sample host-notify-by-email or whatever it's called. Should 
be in the sample config Nagios created during the make cycles.

> # 'notify-by-email' command definition
> define command{
>         command_name    notify-by-email
>         command_line    /usr/bin/printf "%b" "subject: **
> $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$
> ** \n\n ***** 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/msmtp
> $CONTACTEMAIL$
>         }
> 
> Now, this is the same command I use for every other alert, but only the
> check-host-alive check causes an email with NO source, NO state etc.
> 
> Is it just me that gets this? Does the check-host-alive command not fill
> in the $servicedesc$ or the $servicestate$ ?

As you noted, servicestate is not the right thing to report in a host 
check result. There is a list of all available macros in the manual, and 
you'll find the corresponding $HOST...$ ones in there.

The more important question is - why are notifications generated at all? 
You'd have to show us the configuration for one of the hosts in 
question. Also make sure the check command works as you intend it to. 
If, for example, you've got a macro in there that doesn't contain 
anything useful that might easily explain why the check command fails.

Arno

> Olly
> 
> 
> -------------------------------------------------------
> All the advantages of Linux Managed Hosting--Without the Cost and Risk!
> Fully trained technicians. The highest number of Red Hat certifications in
> the hosting industry. Fanatical Support. Click to learn more
> http://sel.as-us.falkag.net/sel?cmd=k&kid7521&bid$8729&dat1642
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
> ::: Messages without supporting info will risk being sent to /dev/null
> 

-- 
IT-Service Lehmann                    al at its-lehmann.de
Arno Lehmann                  http://www.its-lehmann.de


-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list