$SERVICEOUTPUT$ empty in e-mail notifications

Gavin Henry gavin.henry at gmail.com
Tue Jan 6 23:07:22 CET 2009


> 1) The macro isn't included in the notification command being used by
> that contact.
> 2) The macro is mis-typed in that notification command.
> 3) The macro isn't valid for the notification type being sent (i.e. a
> host notification).
>
> Please post the nagios version and how installed (package or source),
> service definition, contactgroup definition, contact definition and
> notification command so we can help narrow it down.

Version:

/opt/nagios/bin/nagios -V

Nagios 3.0.6
Copyright (c) 1999-2008 Ethan Galstad (http://www.nagios.org)
Last Modified: 12-01-2008
License: GPL

Installed by source with --prefix=opt/nagios


Example service definition (all services have the same problem):

define service{
        use                            generic-service
        host_name                 host.example.com
        service_description     PING
        check_command        check_ping!100.0,20%!500.0,60%
         }



Contact Group:

 define contactgroup{
         contactgroup_name       admins
         alias                   Nagios Administrators
         members                 nagiosadmin
         }


Contact:

define contact{
         contact_name                    nagiosadmin
         use   generic-contact
         alias                           gavin.henry
         email                           ghenry at suretecsystems.com
         pager                           07930323266
         }



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


Jabber one which has $SERVICEOUT$ populated:

define command{
        command_name    notify-by-jabber
        command_line    /opt/nagios/libexec/notify_via_jabber
$CONTACTALIAS$ "$NOTIFICATIONTYPE$ $HOSTNAME$ $SERVICEDESC$
$SERVICESTATE$ $SERVICEOUTPUT$ $LONGDATETIME$"
        }




Thanks.

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