Newbie Notifications Problem

Aidan Anderson mail at aidananderson.co.uk
Sun Sep 23 13:46:26 CEST 2007


Ray Wadkins wrote:
>
> define contact{
>
>         contact_name                    rwadkins_e              ; 
> Short name of user
>
>         use                             generic-contact         ; 
> Inherit default values from generic-contact template (defined above)
>
>         alias                           Ray Wadkins             ; Full 
> name of user
>
>         email                           XXXXX    ; <<***** CHANGE THIS 
> TO YOUR EMAIL ADDRESS ******
>
>         host_notifications_enabled      1
>
>         service_notifications_enabled   1
>
>         host_notification_period        24x7
>
>         service_notification_period     24x7
>
>         host_notification_options       d,u,r,f,s
>
>         service_notification_options    w,u,c,r,f,s
>
>         host_notification_commands      notify-host-by-email
>
>         service_notification_commands   notify-service-by-email
>
>   
>
You've specified the command notify-host-by-email in your contact definition
>
> *From commands.cfg*
>
> * *
>
> define command{
>
>         command_name    notify-service-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$" | /bin/mail -s 
> "** $NOTIFICATIONTYPE$ Service Alert: $HOS
>
> TALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
>
>         }
>
>  
>
but don't seem to have defined it in the commands.cfg file.

When a host goes down, only host notifications are sent out (service 
notifications are suppressed).  As you don't seem to have defined a host 
notification command, you will never receive any notifications.  Try 
adding the following to commands.cfg:

> # 'notify-host-by-email' command definition
> define command{
>         command_name    notify-host-by-email
>         command_line    /usr/bin/printf "%b" "Notification Type: 
> $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nDetails: $HOSTALIAS$\nAddress: 
> $HOSTADDRESS$\nState: $HOSTSTATE$\nInfo: $HOSTOUTPUT$\n\nDate/Time: 
> $LONGDATETIME$\n\n$HOSTACKAUTHOR$\n$HOSTACKCOMMENT$\n" | /bin/mail -s 
> "Host $HOSTSTATE$ alert for $HOSTNAME$ - $HOSTALIAS$" $CONTACTEMAIL$
>         }
HTH
Aidan



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
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