All my Icinga notifications arrived with a sender “nagios@monitoring.zeldor.biz” but Iam running icinga and not nagios this is a little bit stupid.
By fixing the “commands.cfg” you can change this behavior as described below:
1 | vim /etc/icinga/commands.cfg |
2 3 4 5 6 7 8 9 10 11 12 | # 'notify-host-by-email' command definition define command{ command_name notify-host-by-email command_line /usr/bin/printf "%b" "***** Icinga *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$ -- -f icinga@monitoring.zeldor.biz } # 'notify-service-by-email' command definition define command{ command_name notify-service-by-email command_line /usr/bin/printf "%b" "***** Icinga *****\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/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$ -- -f icinga@monitoring.zeldor.biz } |
The change is:
Append your sender to the mail command: “– -f icinga@monitoring.zeldor.biz”
Now restart your Icinga service and check your Inbox;)
Leave a Reply