Sending Notes and notes url in emails
Sending Notes and notes url in emails
I apologize for not being able to understand how to do this.
I've read 3 or 4 of your pdf files and looked at some threads, but what ever I'm doing is not working
when an alert email goes out either host or service, we want the default for all users to have both the notes and the notesurl in the email
once i learn how to do that, we installed the object notes tab component also, so I'd like that to go in the email too
can you help dumb this down for me?
thank you
Jennifer
I've read 3 or 4 of your pdf files and looked at some threads, but what ever I'm doing is not working
when an alert email goes out either host or service, we want the default for all users to have both the notes and the notesurl in the email
once i learn how to do that, we installed the object notes tab component also, so I'd like that to go in the email too
can you help dumb this down for me?
thank you
Jennifer
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Sending Notes and notes url in emails
Page 7 of this doc shows how to add custom macros to XI notifications
https://assets.nagios.com/downloads/nag ... iables.pdf
You will need to change the host notification command to have macros for $HOSTNOTESURL$ and $HOSTNOTES$
You will need to change the service notification command to have macros for $SERVICENOTESURL$ and $SERVICENOTES$
https://assets.nagios.com/downloads/nag ... iables.pdf
You will need to change the host notification command to have macros for $HOSTNOTESURL$ and $HOSTNOTES$
You will need to change the service notification command to have macros for $SERVICENOTESURL$ and $SERVICENOTES$
Re: Sending Notes and notes url in emails
I did the notes for both but nothing gets sent
Also
I do not see notes in any form in this pdf you linked?
https://assets.nagios.com/downloads/nag ... 1449766582
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$"
xi_service_notification_handler /usr/bin/php /usr/local/nagiosxi/scripts/handle_nagioscore_notification.php --notification-type=service --contact="$CONTACTNAME$" --contactemail="$CONTACTEMAIL$" --type=$NOTIFICATIONTYPE$ --escalated="$NOTIFICATIONISESCALATED$" --author="$NOTIFICATIONAUTHOR$" --comments="$NOTIFICATIONCOMMENT$" --host="$HOSTNAME$" --hostaddress="$HOSTADDRESS$" --hostalias="$HOSTALIAS$" --hostdisplayname="$HOSTDISPLAYNAME$" --service="$SERVICEDESC$" --hoststate=$HOSTSTATE$ --hoststateid=$HOSTSTATEID$ --servicestate=$SERVICESTATE$ --servicestateid=$SERVICESTATEID$ --lastservicestate=$LASTSERVICESTATE$ --lastservicestateid=$LASTSERVICESTATEID$ --servicestatetype=$SERVICESTATETYPE$ --currentattempt=$SERVICEATTEMPT$ --maxattempts=$MAXSERVICEATTEMPTS$ --serviceeventid=$SERVICEEVENTID$ --serviceproblemid=$SERVICEPROBLEMID$ --serviceoutput="$SERVICEOUTPUT$" --longserviceoutput="$LONGSERVICEOUTPUT$" --datetime="$LONGDATETIME$" --notes="$SERVICENOTES$"
Also
I do not see notes in any form in this pdf you linked?
https://assets.nagios.com/downloads/nag ... 1449766582
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$"
xi_service_notification_handler /usr/bin/php /usr/local/nagiosxi/scripts/handle_nagioscore_notification.php --notification-type=service --contact="$CONTACTNAME$" --contactemail="$CONTACTEMAIL$" --type=$NOTIFICATIONTYPE$ --escalated="$NOTIFICATIONISESCALATED$" --author="$NOTIFICATIONAUTHOR$" --comments="$NOTIFICATIONCOMMENT$" --host="$HOSTNAME$" --hostaddress="$HOSTADDRESS$" --hostalias="$HOSTALIAS$" --hostdisplayname="$HOSTDISPLAYNAME$" --service="$SERVICEDESC$" --hoststate=$HOSTSTATE$ --hoststateid=$HOSTSTATEID$ --servicestate=$SERVICESTATE$ --servicestateid=$SERVICESTATEID$ --lastservicestate=$LASTSERVICESTATE$ --lastservicestateid=$LASTSERVICESTATEID$ --servicestatetype=$SERVICESTATETYPE$ --currentattempt=$SERVICEATTEMPT$ --maxattempts=$MAXSERVICEATTEMPTS$ --serviceeventid=$SERVICEEVENTID$ --serviceproblemid=$SERVICEPROBLEMID$ --serviceoutput="$SERVICEOUTPUT$" --longserviceoutput="$LONGSERVICEOUTPUT$" --datetime="$LONGDATETIME$" --notes="$SERVICENOTES$"
Last edited by jenstar13 on Mon May 06, 2019 7:16 am, edited 1 time in total.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Sending Notes and notes url in emails
Did you add %notes% somewhere in the notification messages for the user?
Click username upper right -> Notification messages
Click username upper right -> Notification messages
Re: Sending Notes and notes url in emails
this is to be for all users
as a test I did add %notes% to the templates, and deployed it to our "admin" account but no luck
***** Nagios XI Alert *****
%alertsummary%
Notification Type: %type%
Host: %host%
State: %hoststate%
Address: %hostaddress%
Info: %hostoutput%
Date/Time: %datetime%
Respond: %responseurl%
Nagios URL: %xiserverurl%
Comments: %comments%
Notes: %notes%
as a test I did add %notes% to the templates, and deployed it to our "admin" account but no luck
***** Nagios XI Alert *****
%alertsummary%
Notification Type: %type%
Host: %host%
State: %hoststate%
Address: %hostaddress%
Info: %hostoutput%
Date/Time: %datetime%
Respond: %responseurl%
Nagios URL: %xiserverurl%
Comments: %comments%
Notes: %notes%
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Sending Notes and notes url in emails
And the host you tested this with had notes defined?
Can you show the output of the test message you received?
Can you show the output of the test message you received?
Re: Sending Notes and notes url in emails
I forced a custom message
-----Original Message-----
From: nagios <[email protected]>
Sent: Monday, May 13, 2019 10:15 AM
To: Operations Support <[email protected]>
Subject: ** CUSTOM PRD Service Alert: prdfrdapp01.prd.xxx.xxxl/Alert 11003 - Check Disk Usage on C:/ is CRITICAL **
*****prdnagxi02 Alert *****
Notification Type: CUSTOM
Service: Alert 11003 - Check Disk Usage on C:/
Host: prdfrdapp01.prd.xxx.xxx
Address: 10.49.xxx.109
State: CRITICAL
Date/Time: Mon May 13 10:15:26 EDT 2019
Additional Info:
CRITICAL: Used disk space was 95.20 % (Used: 118.67 GiB, Free: 5.96 GiB, Total: 124.63 GiB)
-----Original Message-----
From: nagios <[email protected]>
Sent: Monday, May 13, 2019 10:15 AM
To: Operations Support <[email protected]>
Subject: ** CUSTOM PRD Service Alert: prdfrdapp01.prd.xxx.xxxl/Alert 11003 - Check Disk Usage on C:/ is CRITICAL **
*****prdnagxi02 Alert *****
Notification Type: CUSTOM
Service: Alert 11003 - Check Disk Usage on C:/
Host: prdfrdapp01.prd.xxx.xxx
Address: 10.49.xxx.109
State: CRITICAL
Date/Time: Mon May 13 10:15:26 EDT 2019
Additional Info:
CRITICAL: Used disk space was 95.20 % (Used: 118.67 GiB, Free: 5.96 GiB, Total: 124.63 GiB)
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Sending Notes and notes url in emails
The example you showed was for a host, did you add Notes: %notes% to the service as well?
jenstar13 wrote:this is to be for all users
as a test I did add %notes% to the templates, and deployed it to our "admin" account but no luck
***** Nagios XI Alert *****
%alertsummary%
Notification Type: %type%
Host: %host%
State: %hoststate%
Address: %hostaddress%
Info: %hostoutput%
Date/Time: %datetime%
Respond: %responseurl%
Nagios URL: %xiserverurl%
Comments: %comments%
Notes: %notes%
Re: Sending Notes and notes url in emails
yes, sorry did both, just didn't show you services
***** Nagios XI Alert *****
%alertsummary%
Notification Type: %type%
Service: %service%
Host: %host%
Address: %hostaddress%
State: %servicestate%
Info:
%serviceoutput%
Date/Time: %datetime%
Respond: %responseurl%
Nagios URL: %xiserverurl%
Comments: %comments%
Notes: %notes%
***** Nagios XI Alert *****
%alertsummary%
Notification Type: %type%
Service: %service%
Host: %host%
Address: %hostaddress%
State: %servicestate%
Info:
%serviceoutput%
Date/Time: %datetime%
Respond: %responseurl%
Nagios URL: %xiserverurl%
Comments: %comments%
Notes: %notes%
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Sending Notes and notes url in emails
Can you setup a dummy host/service to test with and bring it in a non-OK state, I don't believe the Custom message uses the template.