Changing notification user name
Posted: Wed Apr 30, 2014 5:10 am
Nagios XI Ent 2012R2.9
Manual Install
Red Hat Enterprise Linux 6.5 64 bit
Can you please advice me how to change the name of the sender for email notifications?
Mine is showing nagios, I want it to show NagiosProdXI1
Did some research and some people advised to change the user name in /etc/passwd.
nagios
501:501:NagiosProdXI1:/home/nagios:/bin/bash
Changed it however same thing, rebooted the machine still same.
Sending test email from the GUI works fine.
I am using SMTP relay which is configured at OS level in /etc/mail.rc
Only line added was
set smtp=123.123.188.160
Not using the xi_notify_..., but custom email sending script.
This is the command used to send email for host and service.
/usr/bin/printf "%b" "*** Nagiosprodxi1 *****\n\nNotification Type: $NOTIFICATIONTYPE\nHost: $HOSTNAME\nHost Alias: $HOSTALIAS\nState: $HOSTSTATE\nAddress: $HOSTADDRESS\nInfo: $HOSTOUTPUT\n\nDate/Time: $SHORTDATETIME\n" | /bin/mail -s "** $NOTIFICATIONTYPE Host Alert: $HOSTNAME is $HOSTSTATE **" $CONTACTEMAIL
/usr/bin/printf "%b" "*** Nagiosprodxi1 ****\n\nNotification Type: $NOTIFICATIONTYPE\n\nService: $SERVICEDESC\nHost: $HOSTNAME\nHost Alias: $HOSTALIAS\nAddress: $HOSTADDRESS\nState: $SERVICESTATE\n\nDate/Time: $SHORTDATETIME\n\nAdditional Info:\n\n$SERVICEOUTPUT\n" | /bin/mail -s "** $NOTIFICATIONTYPE Service Alert: $HOSTNAME/$SERVICEDESC is $SERVICESTATE **" $CONTACTEMAIL
Thanks
Manual Install
Red Hat Enterprise Linux 6.5 64 bit
Can you please advice me how to change the name of the sender for email notifications?
Mine is showing nagios, I want it to show NagiosProdXI1
Did some research and some people advised to change the user name in /etc/passwd.
nagios
Changed it however same thing, rebooted the machine still same.
Sending test email from the GUI works fine.
I am using SMTP relay which is configured at OS level in /etc/mail.rc
Only line added was
set smtp=123.123.188.160
Not using the xi_notify_..., but custom email sending script.
This is the command used to send email for host and service.
/usr/bin/printf "%b" "*** Nagiosprodxi1 *****\n\nNotification Type: $NOTIFICATIONTYPE\nHost: $HOSTNAME\nHost Alias: $HOSTALIAS\nState: $HOSTSTATE\nAddress: $HOSTADDRESS\nInfo: $HOSTOUTPUT\n\nDate/Time: $SHORTDATETIME\n" | /bin/mail -s "** $NOTIFICATIONTYPE Host Alert: $HOSTNAME is $HOSTSTATE **" $CONTACTEMAIL
/usr/bin/printf "%b" "*** Nagiosprodxi1 ****\n\nNotification Type: $NOTIFICATIONTYPE\n\nService: $SERVICEDESC\nHost: $HOSTNAME\nHost Alias: $HOSTALIAS\nAddress: $HOSTADDRESS\nState: $SERVICESTATE\n\nDate/Time: $SHORTDATETIME\n\nAdditional Info:\n\n$SERVICEOUTPUT\n" | /bin/mail -s "** $NOTIFICATIONTYPE Service Alert: $HOSTNAME/$SERVICEDESC is $SERVICESTATE **" $CONTACTEMAIL
Thanks