Entri Populer

Monday, March 21, 2011

Change Nagios Sender Address

I need to change the Nagios Sender Address on my server, by default Nagios will set it to "Nagios@Servername" as it sender address. So whenever you receive mail notification from nagios, you will see "Nagios@Servername" on the sender field.

After browsing around, i found : how-do-i-change-email-address-opsview-emails

Since i use postfix on my machine, then i do as instructed :
1. On postfix main.cf file, i added smtp_generic_maps = /etc/postfix/generic (path where your postfix installation)
2. Create file with generic as it name
3. On that file, add a line nagios@servername  alert@mycompanydomain. Save and Exit
4. On linux console, type postmap generic then hit enter.
5. Restart postfix service

and i got what i needed.

Note :
a. You can change generic into whatever filename you like, but make sure on main.cf you also write the same filename.
b. In the link above, you can find other solution for exim4 and sendmail too

Thanks to awijntje

1 comment:

  1. smtp_generic_maps = /etc/postfix/generic

    Should be
    smtp_generic_maps = hash:/etc/postfix/generic

    ReplyDelete