Fwd: $SERVICEOUTPUT$ empty in e-mail notifications

Marc Powell marc at ena.com
Wed Jan 7 14:47:40 CET 2009


On Jan 7, 2009, at 3:21 AM, Gavin Henry wrote:

> OK. Just to point out, the onlt new notification is the jabber one,
> everything else is as per a default source install of Nagios.

Many of the people who are best able to help you have been using  
nagios for so long with customized configs that they don't really know  
what the most recent default templates look like, and aren't likely to  
go research it. It's easier to assume that they're customized in some  
way anyway since that's the normal case.

>      service_notification_commands
> notify-service-by-email,notify-by-jabber        ; send service  
> notifications
> via email

>>> 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$
>>> }

> [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

I'm not seeing anything obviously wrong (but could be missing it).  
strange stuff. I would try simplifying the notification command as  
much as possible to test --

command_line /usr/bin/printf "%b" "output: $SERVICEOUTPUT$" > /tmp/ 
output.txt

See if /tmp/output.txt contains the expected text, then if successful,  
try the same with your notification command all the way through '...\n 
\n$SERVICEOUTPUT$"' to eliminate /usr/bin/mail as a factor.

If not successful, try /bin/echo instead of '/usr/bin/printf "%b"'.

Using nagios-3, you also have easy access to debug mode which should  
provide useful information by setting debug_file and debug_level in  
nagios.cfg.

--
Marc




------------------------------------------------------------------------------
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