|
In the old version of Nagios I remember receiving
Acknowledgement notifications with the author and their comment. Version 2
requires the variables $HOSTACKAUTHORS$ and $HOSTACKCOMMENT$ so I have edited
the misccommands.cfg file to look like this: # 'host-notify-by-email' command definition define command{
command_name host-notify-by-email
command_line /usr/bin/printf "%b" "*****
Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost:
$HOSTNAME$\nState: $HOSTSTATE$\nAuthor: $HOSTACKAUTHOR$\nComment: $ HOSTACKCOMMENT$\nAddress: $HOSTADDRESS$\nInfo:
$HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /bin/mail -s "Host
$HOSTSTATE$ alert for $HOSTNAME$!" $CONTACTEMAIL$ } # 'host-notify-by-epager' command definition define command{
command_name host-notify-by-epager
command_line /usr/bin/printf "%b" "Host
'$HOSTALIAS$' is $HOSTSTATE$\nAuthor: $HOSTACKAUTHOR$\nComment:
$HOSTACKCOMMENT$\nInfo: $HOSTOUTPUT$\nTime: $LONGDATETIME$" | /bin /mail -s "$NOTIFICATIONTYPE$ alert - Host $HOSTNAME$ is
$HOSTSTATE$" $CONTACTPAGER$ } # 'notify-by-email' command definition define command{
command_name notify-by-email
command_line /usr/bin/printf "%b" "*****
Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService:
$SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nStat e: $SERVICESTATE$\nAuthor: $HOSTACKAUTHOR$\nComment:
$HOSTACKCOMMENT$\n\nDate/Time: $LONGDATETIME$\n\nAdditional
Info:\n\n$SERVICEOUTPUT$" | /bin/mail -s "** $NOTIFICATIONTYPE$ aler t - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **"
$CONTACTEMAIL$ } # 'notify-by-epager' command definition define command{
command_name notify-by-epager
command_line /usr/bin/printf "%b" "Service:
$SERVICEDESC$\nHost: $HOSTNAME$\nAddress: $HOSTADDRESS$\nState:
$SERVICESTATE$\nAuthor: $HOSTACKAUTHOR$\nComment: $HOSTACKCOMM ENT$\nInfo: $SERVICEOUTPUT$\nDate: $LONGDATETIME$" |
/bin/mail -s "$NOTIFICATIONTYPE$: $HOSTALIAS$/$SERVICEDESC$ is
$SERVICESTATE$" $CONTACTPAGER$
} By adding the $HOSTACKAUTHORS$ and $HOSTACKCOMMENT$ The only
thing I have accomplished in doing here was adding the new lines for author and
comment to the notifications we receive but no actual data is sent with
it. So I guess I am not quite understanding from the
documentation that “These macros are only valid in notifications where
the $NOTIFICATIONTYPE$ macro is set to "ACKNOWLEDGEMENT".” What I am trying to accomplish is have the acknowledgement author
and comment information that are inputted from the Nagios page to show up in the
notifications. Any help on this would be greatly appreciated. Eddie M. This email is intended only for the use of the individual or entity to which it is addressed and may contain information that is privileged and confidential. If the reader of this email message is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is prohibited. If you have received this email in error, please notify the sender and destroy/delete all copies of the transmittal. Thank you. |
- [Nagios-users] Nagios Acknowledgement Information Eduardo Martinez
- Re: [Nagios-users] Nagios Acknowledgement Informatio... Patrick Morris
- RE: [Nagios-users] Nagios Acknowledgement Inform... Eduardo Martinez
