Hi lmiltchev,
Thanks for the reply.
1) Fortunately i am receiving mail to my email address when i change $CONTACTMAIL$ to my email address at command.cfg file. But i think its for temporarily. When i need to segregrate contacts then i need to do modify. When i use $CONTACTMAIL$ in command.cfg file i can't receive any email during device state change.
CONTACT:
define contact{
contact_name nagiosadmin ; Short name of user
use generic-contact ; Inherit default values from generic-contact template (defined above)
alias Nagios Admin ; Full name of user
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,r
service_notification_commands notify-service-by-email
host_notification_commands notify-host-by-email
email
[email protected] ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
}
COMMAND:
# 'notify-host-by-email' command definition
define command{
command_name notify-host-by-email
command_line /usr/bin/printf "%b" "***** R&R Central Network Monitoring System(NMS) *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/bin/mailx -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **"
[email protected]
}
# 'notify-service-by-email' command definition
define command{
command_name notify-service-by-email
command_line /usr/bin/printf "%b" "***** R&R Central Network Monitoring System(NMS) *****\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 -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **"
[email protected]
}
2) Another thing is that recently i have added proxy email address(
[email protected]) with my enail address by my exchange server & receiving the service notification. But i need to change this email address(From "root@mydomain" to "myemail-address@mydomain"). Could you help by sharing the path?
3) At root@mydomain email address i am reciving following message in every 10 minutes.
Subject: Cron <smmsp@RR-DE-NMS-1> test -x /etc/init.d/sendmail && /usr/share/sendmail/sendmail cron-msp
Body of Message: /usr/share/sendmail/sendmail: 899: /usr/share/sendmail/sendmail: /usr/sbin/sendmail-msp: not found
Before i have installed SendMail & after that i have installed postfix. Is it happening due to SendMail? Should SendMail removal can do that resloution?