COMMENT Macros

Bierstedt, Daniel D.Bierstedt at crh-group.com
Thu Aug 28 17:42:11 CEST 2008


Hello,

my notification command for hosts:

define command{
   command_name   host-notify-by-email
   command_line   /usr/bin/printf "%b" "Notification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$ - $HOSTALIAS$\nState: $HOSTSTATE$\nAddress: $HOSTADDRE    SS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n\n$HOSTACKAUTHOR$ $HOSTACKCOMMENT$" | @MAIL_PROG@ -s "Host $HOSTSTATE$ alert for $HOSTNAME$!" $C    ONTACTEMAIL$
}

Mit freundlichen Gruessen / With best regards

Daniel Bierstedt
IT / Systeme

C. Rob. Hammerstein GmbH & Co KG
Merscheider Str. 167
D-42699 Solingen
phone +49 212 3393 562
fax   +49 212 3393 445
               
mailto:d.bierstedt at crh-group.com                  
http://www.crh-group.com

__________________________________________
This transmission is confidential and intended solely for the person or organization to whom it is addressed.  It may contain privileged and confidential information. If you are not the intended recipient, you should not copy, distribute or take any action in reliance on it.

If you have received this transmission in error, please notify the sender at the e-mail address above.


-----Ursprüngliche Nachricht-----
Von: nagios-users-bounces at lists.sourceforge.net [mailto:nagios-users-bounces at lists.sourceforge.net] Im Auftrag von Ryan Gravlin
Gesendet: Donnerstag, 28. August 2008 17:30
An: nagios-users at lists.sourceforge.net
Betreff: [Nagios-users] COMMENT Macros


Hello all,

I'm trying to include the comments that operators add to host/service acknowledgements.  I currently have this setup as the NOTIFY COMMAND:

# '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: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\nComment: $NOTIFICATIONAUTHORCOMMENT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
        }

Using Nagios 3.0.3.  All I receive is "Comment: $" in the actual e-mail.  I assume I'm missing something obvious but I haven't done much custom macro stuff in Nagios before and I was hoping someone else could shed some light?

I do understand I may need to add additional notify commands due to the use of the $NOTIFICATIONAUTHORCOMMENT$, but this test is a also on a down host, not a service.

Thanks,

Ryan Gravlin

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
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 the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
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