Page 2 of 2
Re: Different notification contents for different users
Posted: Mon Jun 24, 2013 3:04 pm
by hhlodge
They've already modified their notifications, so that's been changed. Now I'm just trying to resole the newlines in the extended info, if we can have multiple lines there. And we upgraded to Enterprise today so I can have those additional features.

Re: Different notification contents for different users
Posted: Mon Jun 24, 2013 3:36 pm
by abrist
hhlodge wrote:They've already modified their notifications, so that's been changed. Now I'm just trying to resole the newlines in the extended info, if we can have multiple lines there. And we upgraded to Enterprise today so I can have those additional features.

Just to verify, you have defined the long output for the user specific notification? Could you post screenshot of that portion of the notification template?
Re: Different notification contents for different users
Posted: Tue Jun 25, 2013 7:20 am
by hhlodge
If you meant "long" output, yes - we all see it now. As for notification template, I don't know what you want. I have service and contact templates. Is one of those what you want to see? Regardless, I still don't know how this affects the newlines in the expansion of $LONGSERVICEOUTPUT$.
Re: Different notification contents for different users
Posted: Wed Jun 26, 2013 7:24 am
by scottwilkerson
I believe what Andy is looking for is the Notification Messages template by clicking on the username (top right) and the Notification Messages
Re: Different notification contents for different users
Posted: Wed Jun 26, 2013 1:44 pm
by hhlodge
Here is mine. I Just see "\n" in the extended info as well.
Code: Select all
***** Nagios XI Alert *****
Notification Type: %type%
Service: %service%
Host: %hostalias%
Address: %hostaddress%
State: %servicestate%
Info: %serviceoutput%
Extended info: %longserviceoutput%
Date/Time: %datetime%
Author: %author%
Comment: %comments%
Notified: %notificationrecipients%
Respond: %responseurl%
Nagios URL: %xiserverurl%
Re: Different notification contents for different users
Posted: Wed Jun 26, 2013 5:08 pm
by abrist
hmmm. Looks like the "\n" is not getting parsed as a newline in the notification component. We may have to use a crafty escaped shell command for the notification command as a bandaid until we can hunt down the fix:
Code: Select all
--longserviceoutput="$$(echo "$LONGSERVICEOUTPUT$" | sed 's/\\n/<br \/>/g' )"
I tested it, it works. It replaces "\n" with "<br />". Ugly, but it works.
Re: Different notification contents for different users
Posted: Thu Jun 27, 2013 10:29 am
by hhlodge
I'll take ugly any day - works great. Thank you!
Re: Different notification contents for different users
Posted: Thu Jun 27, 2013 10:38 am
by abrist
Great! Glad it works for you as well, though the escaping is definitely odd. Anything else or shall we lock this thread?
Re: Different notification contents for different users
Posted: Thu Jun 27, 2013 12:46 pm
by hhlodge
All good - lock it. Good to know we can use shell commands in there.