Page 1 of 1
Nagios Notification Configuration
Posted: Tue Apr 16, 2013 1:28 am
by nickyls
hello all!
i have installed nagios3 on ubuntu platform. I have configured notification using postfix.
Now, in from mail address i want to remove "nagios@" prefix. How to do?
Re: Nagios Notification Configuration
Posted: Tue Apr 16, 2013 7:29 am
by gshergill
Hi nickyls,
There is a mailx option which lets you do this which is "-r".
Below is an example:
Code: Select all
define command{
command_name notify-service-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n" | /usr/bin/mailx -r [email protected] -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}
Kind Regards,
Gary Shergill
Re: Nagios Notification Configuration
Posted: Tue Apr 16, 2013 2:05 pm
by scottwilkerson
Again, Gary is correct, if you leave the -r off it is going to mail from nagios@machine_name
Re: Nagios Notification Configuration
Posted: Tue Apr 16, 2013 11:13 pm
by nickyls
Thank you for quick reply.
But in our instance if i add
-r [email protected] the nagios didnt send any notification. The email id
[email protected] is provided while configuring Postfix.
Re: Nagios Notification Configuration
Posted: Wed Apr 17, 2013 6:57 am
by gshergill
Hi nickyls,
If it's no longer sending the notification after adding the "-r", there may be a mistake in your command definition.
Could you please paste the command definition you are using?
Also, just to confirm, are you using mailx?
Thank you.
Kind Regards,
Gary Shergill
Re: Nagios Notification Configuration
Posted: Wed Apr 17, 2013 5:25 pm
by abrist
Any update on this nickyls?