Nagios3 - SMS Teams

Nagios contact configured with custom host and service notifications for SMS:

define contact {
       alias SMS
       contact_name sms
       service_notification_period 24x7
       service_notification_options w,u,c,r
       service_notification_commands notify-by-sms-service
       host_notification_period 24x7
       host_notification_options d,r
       host_notification_commands notify-by-sms-host
}

define command {
       command_name notify-by-sms-service
       command_line /x/sms_nagios.sh $HOSTNAME$ $SERVICEDESC$ $SERVICESTATE$
}

define command {
       command_name notify-by-sms-host
       command_line /x/sms_nagios.sh $HOSTNAME$ $HOSTDESC$ $HOSTSTATE$
}

Nagios contact configured with custom host and service notifications for MS Teams: define contact { alias Teams contact_name teams service_notification_period 24x7 service_notification_options w,u,c,r service_notification_commands notify-by-teams-service host_notification_period 24x7 host_notification_options d,r host_notification_commands notify-by-teams-host }

define command { command_name notify-by-teams-service command_line /x/msteams_nagios.sh $NOTIFICATIONTYPE$ ‘curl -H “Content-Type: application/json” -d “{"title": "$NOTIFICATIONTYPE$ alert - $HOSTNAME$/$SERVICEDESC$ is $SERVICESTATE$", "text": "*** ***\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$ ($SERVICENOTESURL$)\n\nHost: $HOSTNAME$ ($HOSTALIAS$)\n\nAddress: $HOSTADDRESS$\n\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info: $SERVICEOUTPUT$", "themeColor": "EA4300", "type": "", "potentialAction": [{"@context": "http://schema.org", "@type": "ViewAction", "name": "x", "target": ["https://x.x.x.x/x"]}] }” https://x }

define command { command_name notify-by-teams-host command_line /x/msteams_nagios.sh $NOTIFICATIONTYPE$ ‘curl -H “Content-Type: application/json” -d “{"title": "$NOTIFICATIONTYPE$ alert - $HOSTNAME$ is $HOSTSTATE$", "text": "*** ***\n\nNotification Type: $NOTIFICATIONTYPE$\n\nHost: $HOSTNAME$ ($HOSTALIAS$)\n\nAddress: $HOSTADDRESS$\nnState: $HOSTSTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info: $HOSTOUTPUT$", "themeColor": "EA4300", "type": "", "potentialAction": [{"@context": "http://schema.org", "@type": "ViewAction", "name": "x", "target": ["https://x.x.x.x/x"]}] }” https:x }