Page 1 of 3

Sending Notes and notes url in emails

Posted: Fri May 03, 2019 9:52 am
by jenstar13
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

Re: Sending Notes and notes url in emails

Posted: Fri May 03, 2019 11:25 am
by scottwilkerson
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$

Re: Sending Notes and notes url in emails

Posted: Mon May 06, 2019 6:38 am
by jenstar13
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$"

Re: Sending Notes and notes url in emails

Posted: Mon May 06, 2019 6:53 am
by scottwilkerson
Did you add %notes% somewhere in the notification messages for the user?
Click username upper right -> Notification messages

Re: Sending Notes and notes url in emails

Posted: Mon May 13, 2019 6:49 am
by jenstar13
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

Posted: Mon May 13, 2019 8:57 am
by scottwilkerson
And the host you tested this with had notes defined?

Can you show the output of the test message you received?

Re: Sending Notes and notes url in emails

Posted: Mon May 13, 2019 9:17 am
by jenstar13
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)

Re: Sending Notes and notes url in emails

Posted: Mon May 13, 2019 9:45 am
by scottwilkerson
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

Posted: Mon May 13, 2019 9:49 am
by jenstar13
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%

Re: Sending Notes and notes url in emails

Posted: Mon May 13, 2019 9:51 am
by scottwilkerson
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.