Customise email notifications

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
McHenry
Posts: 16
Joined: Thu Jan 15, 2015 5:01 pm

Customise email notifications

Post by McHenry »

I have email notifications for warning and critical situations and it works well.

I would like to customise these notifications where possible starting with the sender address.

Presently all emails received originate from: nagios@localhost.localdomain
I would like the emails to be sent from: myserver@mydomain.com

I thought the networking config was set correctly as per below however the hosts file still has the default settings.

[root@myserver ~]# hostname
myserver.mydomain.com
[root@myserver ~]#
[root@myserver ~]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
[root@myserver ~]#
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Customise email notifications

Post by mcapra »

Can you share the command definition(s) you are currently using for your notification commands?

The answer to this depends on which mail client you're using as well as some things on the mail server side. Here's how to set the "sender" address if you're using mailx:
https://stackoverflow.com/questions/129 ... lx-command
Former Nagios employee
https://www.mcapra.com/
kyang

Re: Customise email notifications

Post by kyang »

Thanks for the help @mcapra!
Locked