Fwd: $SERVICEOUTPUT$ empty in e-mail notifications
Gavin Henry
gavin.henry at gmail.com
Wed Jan 7 10:21:13 CET 2009
---------- Forwarded message ----------
From: Gavin Henry <gavin.henry at gmail.com>
Date: 2009/1/7
Subject: Re: [Nagios-users] $SERVICEOUTPUT$ empty in e-mail notifications
To: Marc Powell <marc at ena.com>
2009/1/6 Marc Powell <marc at ena.com>:
>
> On Jan 6, 2009, at 4:07 PM, Gavin Henry wrote:
>
>> Version:
>>
>> /opt/nagios/bin/nagios -V
>>
>> Nagios 3.0.6
>
> Thanks.
>
>> Example service definition (all services have the same problem):
>
> I was hoping to get a more complete picture of the information below
> but you seem to have all of the really key parts within inherited
> templates that weren't included. I'm at first trying to review your
> configuration and logic for errors.
OK. Just to point out, the onlt new notification is the jabber one,
everything else is as per a default source install of Nagios.
> define service{
>> use generic-service
>> host_name host.example.com
>> service_description PING
>> check_command check_ping!100.0,20%!500.0,60%
>> }
>
> What are the contacts/contact_groups for this service defined in the
> template? Please post the generic-service template.
As per defaults:
# Generic service definition template - This is NOT a real service,
just a template!
define service{
name generic-service ; The 'name'
of this service template
active_checks_enabled 1 ; Active service
checks are enabled
passive_checks_enabled 1 ; Passive service
checks are enabled/accepted
parallelize_check 1 ; Active service
checks should be parallelized (disabling this can lead to major
performance problems)
obsess_over_service 1 ; We
should obsess
over this service (if necessary)
check_freshness 0 ;
Default is to NOT
check service 'freshness'
notifications_enabled 1 ; Service
notifications are enabled
event_handler_enabled 1 ; Service event
handler is enabled
flap_detection_enabled 1 ; Flap
detection is enabled
failure_prediction_enabled 1 ;
Failure prediction
is enabled
process_perf_data 1 ;
Process performance data
retain_status_information 1 ; Retain status
information across program restarts
retain_nonstatus_information 1 ;
Retain non-status
information across program restarts
is_volatile 0 ; The
service is not volatile
check_period 24x7 ; The
service can be
checked at any time of the day
max_check_attempts 3 ;
Re-check the service up
to 3 times in order to determine its final (hard) state
normal_check_interval 10 ; Check
the service every
10 minutes under normal conditions
retry_check_interval 2 ;
Re-check the service
every two minutes until a hard state can be determined
contact_groups admins ;
Notifications get
sent out to everyone in the 'admins' group
notification_options w,u,c,r ; Send
notifications about warning,
unknown, critical, and recovery events
notification_interval 60 ;
Re-notify about service
problems every hour
notification_period 24x7 ;
Notifications can be
sent out at any time
register 0 ; DONT REGISTER
THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
}
>> Contact:
>>
>> define contact{
>> contact_name nagiosadmin
>> use generic-contact
>> alias gavin.henry
>> email ghenry at suretecsystems.com
>> pager 07930323266
>> }
>
> Please post the generic-contact template. It includes the
> service_notification_commands and host_notification_commands
> specifications that needs to be verified.
# Generic contact definition template - This is NOT a real contact,
just a template!
define contact{
name generic-contact ; The name
of this contact template
service_notification_period 24x7 ;
service notifications
can be sent anytime
host_notification_period 24x7 ; host
notifications
can be sent anytime
service_notification_options w,u,c,r,f,s ; send
notifications for all service states, flapping events, and scheduled
downtime events
host_notification_options d,u,r,f,s ; send
notifications for all host states, flapping events, and scheduled
downtime events
service_notification_commands
notify-service-by-email,notify-by-jabber ; send service notifications
via email
host_notification_commands
notify-host-by-email,host-notify-by-jabber ; send host notifications
via email
register 0 ; DONT
REGISTER THIS
DEFINITION - ITS NOT A REAL CONTACT, JUST A TEMPLATE!
}
>> Service Email notification:
>>
>> 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$\n State:
>> $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional
>> Info:\n\n$SERVICEOUTPUT$" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$
>> Service Alert: $HOSTALIAS$/$SERVICEDESC $ is $SERVICESTATE$ **"
>> $CONTACTEMAIL$
>> }
>
> Assuming that this is the service_notification_command specified for
> nagiosadmin and the notification is a SERVICE NOTIFICATION, this looks
> ok. You _may_ have a typo at "Service Alert: $HOSTALIAS$/
> $SERVICEDESC $" but the extra spaces may have been inadvertently
> added within the email to the list(?).
Yeah, added within the email, I've double checked the command.
> Please post nagios.log NOTIFICATION examples where the problem has
> occurred for this contact.
There doesn't appear to be a problem in the logs:
[1231294590] SERVICE NOTIFICATION:
nagiosadmin;mail.suretecgroup.com;HTTP;OK;notify-by-jabber;HTTP OK -
HTTP/1.1 302 Found - 0.002 second response time
[1231294590] SERVICE NOTIFICATION:
nagiosadmin;mail.suretecgroup.com;HTTP;OK;notify-service-by-email;HTTP
OK - HTTP/1.1 302 Found - 0.002 second response time
only with the email out?
--
http://www.suretecsystems.com/services/openldap/
--
http://www.suretecsystems.com/services/openldap/
------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
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