Different notifications for the same contact
Posted: Wed Aug 14, 2019 8:43 pm
I customezed notify-service-by-email command and saved it as notify-service-by-email-GDF :
/usr/bin/printf "%b" "***** Gestion de Flota*****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n" | /bin/mail -s "** GDF ** $SERVICESTATE$ -- $SERVICEDESC$" $CONTACTEMAIL$
How can I send this email when a service is alerted and send the command notify-service-by-email to the same contact or Contact-group, when other services are alerted?
/usr/bin/printf "%b" "***** Gestion de Flota*****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n" | /bin/mail -s "** GDF ** $SERVICESTATE$ -- $SERVICEDESC$" $CONTACTEMAIL$
How can I send this email when a service is alerted and send the command notify-service-by-email to the same contact or Contact-group, when other services are alerted?