Reg alert mail content

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
inas.labib
Posts: 170
Joined: Tue Sep 11, 2012 3:48 am

Reg alert mail content

Post by inas.labib »

Hi ,
We use Nagios XI 5.2.2.
In the notification mail, Nagios is sending only the first line of the error. We need all lines(complete error output) to be displayed in the alert mail .We tried adding $LONGSERVICEOUTPUT$ in "notify-service-by-email" command , still no use. Please assist.

Alert in Nagios:
Error: Threshold-0 DB Value-13
ABC Customer has "0" Trans in 1 Minute. Time Frame is :-- 29-NOV-2015 to 30-NOV-2015

Mail content :
Error: Threshold-0 DB Value-13

Thanks
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Reg alert mail content

Post by hsmith »

Can you make the change in Admin --> Notification Management --> Email Messages and let me know if that resolves your issue?
Former Nagios Employee.
me.
inas.labib
Posts: 170
Joined: Tue Sep 11, 2012 3:48 am

Re: Reg alert mail content

Post by inas.labib »

Hi ,

Tried as suggested , its working ..

i) Can we use this template for only specific services ?
ii) The result is coming in single line as below, can we make it as separate lines ?

State: CRITICAL
Info:
Tue Dec 1 03:13:17 GST 2015\n\n----------- SCAN SUMMARY -----------\nKnown viruses: 4128497\nEngine version: 0.98.7\nScanned directories: 30286\nScanned files: 278755\nInfected files:89\nData scanned: 16748.23 MB\nData read: 12005.41 MB (ratio 1.40:1)\nTime: 3813.243 sec (63 m 33 s)


Thanks,
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Reg alert mail content

Post by hsmith »

inas.labib wrote:Can we use this template for only specific services ?
This page allows for notification settings to be saved and deployed to all users, a selection of users, or users in a selection contact groups. This component will only update notification settings for contacts that are created by Nagios XI, or contacts created according to the XI Users and Contacts. Unless notification settings are locked, all users can still modify their own notification settings from the Configure->My Account Settings-> Notification Options page.
Unless I'm mistaken, you'll need different users set up for the different services if you want to change the message.
inas.labib wrote:The result is coming in single line as below, can we make it as separate lines ?
The \n should be a newline. It could be filtered by your email client. You could try <BR> after each line if HTML isn't filtered.
Former Nagios Employee.
me.
inas.labib
Posts: 170
Joined: Tue Sep 11, 2012 3:48 am

Re: Reg alert mail content

Post by inas.labib »

We still receive nagios notification mails as below.
We use Outlook , kindly advice is there any settings we need to modify @ Outlook client side.

State: CRITICAL
Info:
Tue Dec 1 03:13:17 GST 2015\n\n----------- SCAN SUMMARY -----------\nKnown viruses: 4128497\nEngine version: 0.98.7\nScanned directories: 30286\nScanned files: 278755\nInfected files:89\nData scanned: 16748.23 MB\nData read: 12005.41 MB (ratio 1.40:1)\nTime: 3813.243 sec (63 m 33 s)
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Reg alert mail content

Post by tmcdonald »

Please see the post from @hsmith regarding the newlines:
hsmith wrote:The \n should be a newline. It could be filtered by your email client. You could try <BR> after each line if HTML isn't filtered.
Your email client might be assuming the email is in HTML, so the \n is treated as two separate characters. You can try changing those to <br /> instead of \n if that is the case. Otherwise you will need to speak to your mail admin as that is an Outlook setting.
Former Nagios employee
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: Reg alert mail content

Post by avandemore »

The newline should be \r\n for plain text email and outlook client, or just a <br> for html. (<br /> works too.)
Previous Nagios employee
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Reg alert mail content

Post by tmcdonald »

@inas.labib please let us know if this works out for you.
Former Nagios employee
Locked