Hi
I 'm new to the forum , the first greetings to all and feel my low level of English , I hope I understand
I 'm trying to change the default email address is [email protected] and want to change by [email protected] 've searched the forum and solutions that do not work me , please help .
Here you can see my command.cfg
# 'notify-host-by-email' command definition
define command{
command_name notify-host-by-email
command_line /usr/bin/printf "%b" "***** Nagios Host Notification*****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n\nPerformance Host Data: $HOSTPERFDATA$" | /bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$ -f [email protected]
}
# 'notify-service-by-email' command definition
define command{
command_name notify-service-by-email
command_line /usr/bin/printf "%b" "***** Nagios Service Notification*****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info: $SERVICEOUTPUT$\n\nPerformance Service Data: $SERVICEPERFDATA$" | /bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$ -f [email protected]
}
Thanks
Change the default email address
Re: Change the default email address
Try changin the -f to -r:
Let us know if that works for you.
Code: Select all
# 'notify-host-by-email' command definition
define command{
command_name notify-host-by-email
command_line /usr/bin/printf "%b" "***** Nagios Host Notification*****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n\nPerformance Host Data: $HOSTPERFDATA$" | /bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$ -r [email protected]
}
# 'notify-service-by-email' command definition
define command{
command_name notify-service-by-email
command_line /usr/bin/printf "%b" "***** Nagios Service Notification*****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info: $SERVICEOUTPUT$\n\nPerformance Service Data: $SERVICEPERFDATA$" | /bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$ -r [email protected]
}Re: Change the default email address
Are you trying to change your contact's email from [email protected] to [email protected], or you want to change the "from" email address? Can you show us the contact definition, and an actual email that was received by this contact?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Change the default email address
The command already has the email specified, as $CONTACTEMAIL$. What you need to do is change that variable.
Take a look at /usr/local/nagios/etc/contacts.cfg, and change the email listed for 'nagiosadmin'. Then, run service nagios restart to reload your configuration files.
Take a look at /usr/local/nagios/etc/contacts.cfg, and change the email listed for 'nagiosadmin'. Then, run service nagios restart to reload your configuration files.
Former Nagios Employee
Re: Change the default email address
good morning.
I use sendmail and editing the sendmail configuration file is already solved by changing the domain. with nagios configuration files it has not been possible . thanks for the help
I use sendmail and editing the sendmail configuration file is already solved by changing the domain. with nagios configuration files it has not been possible . thanks for the help
Re: Change the default email address
Just to confirm - are we good to mark this thread as resolved?
Former Nagios Employee
Re: Change the default email address
yes....thanks !!! 
Re: Change the default email address
Glad we were able to help. We'll lock this thread now and feel free to open another should you require assistance with anything else.
Be sure to check out the Knowledgebase for helpful articles and solutions!