Page 1 of 1
how to change the default sender of nagios mail notification
Posted: Tue Sep 24, 2013 12:48 am
by gyang27
Hi,
I want to change the default sender (
[email protected])of nagios email notification. so the sender can be customized not
[email protected],
maybe something likes
[email protected]. Is it possible to modify this? how to?
Thanks
Gary
Re: how to change the default sender of nagios mail notifica
Posted: Tue Sep 24, 2013 10:58 am
by abrist
It all depends how you are sending mail. It could be a postfix setting, sendmail setting, exim, or others. Usually the mails are sent as user nagios as the mail is sent from the system user nagios. You will need to alter your mta config to send as a different user.
Re: how to change the default sender of nagios mail notifica
Posted: Tue Sep 24, 2013 10:01 pm
by gyang27
Thanks for your reply. I use the sendmail as my MTA. but I don't know how to change it to meet with my demand.
Could you please show me the details?
Appreciate your help.
Re: how to change the default sender of nagios mail notifica
Posted: Wed Sep 25, 2013 10:27 am
by abrist
You could try adding:
To the end of your notification commands. Then change the "admin_email" directive in nagios.conf to the email address of your choice.
Re: how to change the default sender of nagios mail notifica
Posted: Thu Sep 26, 2013 12:59 am
by gyang27
Great!
I got another way to make it true. I added "-- -f
[email protected] -F sys-admin" in command.cfg
It works now. Thanks you again.
I have another question here. the command check_disk with parameter -u GB doesn't work
"command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_disk -u GB -a $ARG1$ $ARG2$ $ARG3$", I didn't find error in the command line
but I don;t know why it still display MB not GB. any suggestion?
thanks
Re: how to change the default sender of nagios mail notifica
Posted: Thu Sep 26, 2013 9:47 am
by abrist
gyang27 wrote:I got another way to make it true. I added "-- -f
[email protected] -F sys-admin" in command.cfg
That will work as well, though the 'from address' and 'return address' are slightly different. If you have issues sending through relays, you may want to set both.
gyang27 wrote:but I don;t know why it still display MB not GB. any suggestion?
It looks like you may need move the unit (-u GB) switch into the arguments. I tested the check from the cli and it works correctly here.
Do note: You will have to remove the RRD and XML associated with this check (if you rae using rrds and pnp4nagios) as the metric will change to GB (leading to much smaller performance numbers).
Can you run your check from the cli?