ADD NEW TEXT

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
phillay151
Posts: 4
Joined: Mon Apr 03, 2017 9:57 am
Contact:

ADD NEW TEXT

Post by phillay151 »

Hi,

I need to change the email notification message how do I do that?

like this is the notification message I get

Notification Type: RECOVERY

Service: check_http www.google.ca
Host: hostname
Address: 192.168.1.2
State: OK

Date/Time: Fri Mar 24 16:27:36 EDT 2017

Additional Info:

HTTP OK: Status line output matched 1 200 - 60531 bytes in 4.859 second response time


is there anyway i can change the whole thing? like i want a message just for this host only.

please let me know
Prendre soin de sa sante viagrasansordonnancefr.com meilleure pharmacie
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: ADD NEW TEXT

Post by cdienger »

The default email templates are defined in /usr/local/nagios/etc/objects/commands.cfg with the command_lines for "notify-host-by-email" and "notify-service-by-email."
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
phillay151
Posts: 4
Joined: Mon Apr 03, 2017 9:57 am
Contact:

Re: ADD NEW TEXT

Post by phillay151 »

is there a way to put this in place ?


Here is the subject and body of the emails:

Subject:

Anomaly - Monitoring of the website (wwbsite.com) -% type of anomaly%

Type of anomaly:% type of anomaly%

Body :

--------------------------------------------------------------------------------------------------------------------------------

Hello,

This is to notify you that we have detected an anomaly on the website : website.com

Type of anomaly:% type of anomaly%

Please check the website as soon as possible.

Have a good day.

--------------------------------------------------------------------------------------------------------------------------------
Prendre soin de sa sante viagrasansordonnancefr.com meilleure pharmacie
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: ADD NEW TEXT

Post by cdienger »

You can try something like:

command_line /usr/bin/printf "%b" "Hello,\n\nThis is to notify you that we have detected an anomaly on the website : $ADDRESS$\n\nType of anonmaly: $NOTIFICATIONTYPE$\n\nPlease check the website as soon as possible.\n\nHave a good day.| /bin/mail -s "Anomaly - Monitoring of the website($ADDRESS) - $NOTIFICATIONTYPE$" $CONTACTEMAIL$

List of default macros can be found at:

https://assets.nagios.com/downloads/nag ... olist.html
https://assets.nagios.com/downloads/nag ... olist.html
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
phillay151
Posts: 4
Joined: Mon Apr 03, 2017 9:57 am
Contact:

Re: ADD NEW TEXT

Post by phillay151 »

sorry i'm new at this i do not understand this :( lol
Prendre soin de sa sante viagrasansordonnancefr.com meilleure pharmacie
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: ADD NEW TEXT

Post by cdienger »

/usr/local/nagios/etc/objects/commands.cfg contains a definition for "notify-service-by-email" which specifies the format of the email with command_line. You can modify this line/format as you see fit. After making the changes you need to restart the serivce with "service nagios restart"
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
phillay151
Posts: 4
Joined: Mon Apr 03, 2017 9:57 am
Contact:

Re: ADD NEW TEXT

Post by phillay151 »

is that for one host only ?!?!
Prendre soin de sa sante viagrasansordonnancefr.com meilleure pharmacie
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: ADD NEW TEXT

Post by cdienger »

No, this would apply to all services or hosts that call it.

You may find it beneficial to bookmark https://library.nagios.com/library/prod ... e/manuals/ which has links to further documentation that can help you with configuration Nagios.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked