Hello.
I looked at the very good XI Understanding Notification Variable how to guide.
I was wanting to see if there was an easy way to send in the alert email the information we put in to our
Host notes.
We like to put in our Circuit IDs, ISP phone numbers , and things like that. It would be great to have that info
already added to an alert without having to go back in and make custom variables as described in the how to guide.
Any direction or help would be great..
Add Host Notes to notifications emails
-
npolovenko
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Add Host Notes to notifications emails
Hello, @WVUhealth. You might be able to use the $HOSTNOTES$ macro by adding it to your notification command. I can test this out in the lab if you let me know what notification command you're using: notify_host_by_email or xi_host_notification_handler?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Add Host Notes to notifications emails
Thanks . I did not see that var $HOSTNOTES$ . I will give it a try
As for the notify_host_by_email or xi_host_notification_handler question. it looks like my contact show its xi_host_notification_handler.
If that is not correct please let me know how to verify.
under define contact {
service_notification_commands xi_service_notification_handler
host_notification_commands xi_host_notification_handler
As for the notify_host_by_email or xi_host_notification_handler question. it looks like my contact show its xi_host_notification_handler.
If that is not correct please let me know how to verify.
under define contact {
service_notification_commands xi_service_notification_handler
host_notification_commands xi_host_notification_handler
-
npolovenko
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Add Host Notes to notifications emails
@WVUhealth, Ok, here's what you need to do then.
https://assets.nagios.com/downloads/nag ... iables.pdf
1. Open the xi_host_notification_handler command from the commands menu in Core Configurations Manager:
2. Open the notification message editor, page 6 of the pdf tutorial I sent you. And add something like this at the end:
https://assets.nagios.com/downloads/nag ... iables.pdf
1. Open the xi_host_notification_handler command from the commands menu in Core Configurations Manager:
And add --notes="$HOSTNOTES$" at the end, just like in my command./usr/bin/php /usr/local/nagiosxi/scripts/handle_nagioscore_notification.php --notification-type=host --contact="$CONTACTNAME$" --contactemail="$CONTACTEMAIL$" --type=$NOTIFICATIONTYPE$ --escalated="$NOTIFICATIONISESCALATED$" --author="$NOTIFICATIONAUTHOR$" --comments="$NOTIFICATIONCOMMENT$" --host="$HOSTNAME$" --hostaddress="$HOSTADDRESS$" --hostalias="$HOSTALIAS$" --hostdisplayname="$HOSTDISPLAYNAME$" --hoststate=$HOSTSTATE$ --hoststateid=$HOSTSTATEID$ --lasthoststate=$LASTHOSTSTATE$ --lasthoststateid=$LASTHOSTSTATEID$ --hoststatetype=$HOSTSTATETYPE$ --currentattempt=$HOSTATTEMPT$ --maxattempts=$MAXHOSTATTEMPTS$ --hosteventid=$HOSTEVENTID$ --hostproblemid=$HOSTPROBLEMID$ --hostoutput="$HOSTOUTPUT$" --longhostoutput="$LONGHOSTOUTPUT$" --datetime="$LONGDATETIME$" --notes="$HOSTNOTES$"
2. Open the notification message editor, page 6 of the pdf tutorial I sent you. And add something like this at the end:
"My Host Notes" can be changed to whatever message you want to see in the email.My Host Notes: %notes%
You do not have the required permissions to view the files attached to this post.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Add Host Notes to notifications emails
Updated the command , and my notification. Got nothing.
I know my notification were updated as it showed in my email
Host Notes:
Just wanted to confirm HOSTNOTES is an already built in variable as I have not seen documentation on that .
If it is not. Can we make it so i dont have to create custom macro per host ?!
running Nagios XI 5.5.11
xi_host_notification_handler /usr/bin/php /usr/local/nagiosxi/scripts/handle_nagioscore_notification.php --notification-type=host --contact="$CONTACTNAME$" --contactemail="$CONTACTEMAIL$" --type=$NOTIFICATIONTYPE$ --escalated="$NOTIFICATIONISESCALATED$" --author="$NOTIFICATIONAUTHOR$" --comments="$NOTIFICATIONCOMMENT$" --host="$HOSTNAME$" --hostaddress="$HOSTADDRESS$" --hostalias="$HOSTALIAS$" --hostdisplayname="$HOSTDISPLAYNAME$" --hoststate=$HOSTSTATE$ --hoststateid=$HOSTSTATEID$ --lasthoststate=$LASTHOSTSTATE$ --lasthoststateid=$LASTHOSTSTATEID$ --hoststatetype=$HOSTSTATETYPE$ --currentattempt=$HOSTATTEMPT$ --maxattempts=$MAXHOSTATTEMPTS$ --hosteventid=$HOSTEVENTID$ --hostproblemid=$HOSTPROBLEMID$ --hostoutput="$HOSTOUTPUT$" --longhostoutput="$LONGHOSTOUTPUT$" --datetime="$LONGDATETIME$" --notes="$HOSTNOTES$"
I know my notification were updated as it showed in my email
Host Notes:
Just wanted to confirm HOSTNOTES is an already built in variable as I have not seen documentation on that .
If it is not. Can we make it so i dont have to create custom macro per host ?!
running Nagios XI 5.5.11
xi_host_notification_handler /usr/bin/php /usr/local/nagiosxi/scripts/handle_nagioscore_notification.php --notification-type=host --contact="$CONTACTNAME$" --contactemail="$CONTACTEMAIL$" --type=$NOTIFICATIONTYPE$ --escalated="$NOTIFICATIONISESCALATED$" --author="$NOTIFICATIONAUTHOR$" --comments="$NOTIFICATIONCOMMENT$" --host="$HOSTNAME$" --hostaddress="$HOSTADDRESS$" --hostalias="$HOSTALIAS$" --hostdisplayname="$HOSTDISPLAYNAME$" --hoststate=$HOSTSTATE$ --hoststateid=$HOSTSTATEID$ --lasthoststate=$LASTHOSTSTATE$ --lasthoststateid=$LASTHOSTSTATEID$ --hoststatetype=$HOSTSTATETYPE$ --currentattempt=$HOSTATTEMPT$ --maxattempts=$MAXHOSTATTEMPTS$ --hosteventid=$HOSTEVENTID$ --hostproblemid=$HOSTPROBLEMID$ --hostoutput="$HOSTOUTPUT$" --longhostoutput="$LONGHOSTOUTPUT$" --datetime="$LONGDATETIME$" --notes="$HOSTNOTES$"
Re: Add Host Notes to notifications emails
screen shot
You do not have the required permissions to view the files attached to this post.
-
npolovenko
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Add Host Notes to notifications emails
@WVUhealth, Yes, $HOSTNOTES$ macro is built in into Core.
https://assets.nagios.com/downloads/nag ... #hostnotes
Did you put your host notes in this field?
https://assets.nagios.com/downloads/nag ... #hostnotes
Did you put your host notes in this field?
You do not have the required permissions to view the files attached to this post.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.