Newbie Notifications Problem
Ray Wadkins
rwadkins at tervela.com
Mon Sep 24 15:37:04 CEST 2007
Thanks for the reply. I didn't include notify-host-by-email because it
didn't seem relevant, but it's in commands.cfg (pasted below). The host
isn't failing, just the service. When you say "service notifications
are suppressed" what do you mean? Is there a configuration I can't see
that's suppressing service notifications?
# 'notify-host-by-email' command definition
define command{
command_name notify-host-by-email
command_line /usr/bin/printf "%b" "***** Nagios
*****\n\nNotification
Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState:
$HOSTSTATE$\nAddress: $HOSTA
DDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /bin/mail
-s "** $
NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **"
$CONTACTEMAIL$
}
-----Original Message-----
From: nagios-users-bounces at lists.sourceforge.net
[mailto:nagios-users-bounces at lists.sourceforge.net] On Behalf Of Aidan
Anderson
Sent: Sunday, September 23, 2007 7:46 AM
To: Nagios Users mailinglist
Subject: Re: [Nagios-users] Newbie Notifications Problem
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
-------------------------------------------------------------------------
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