jo - https://github.com/jpmens/jo
- Put your own webhook url in the script
- Put the script in /usr/local/nagios/libexec/sendMSTeamsNotification.sh (this may differ depending on your installation I guess)
- Edit your commands.cfg file and add these entries:
define command{
command_name notify-service-by-ms-teams
command_line /usr/local/nagios/libexec/sendMSTeamsNotification.sh "$NOTIFICATIONTYPE$" "Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$"
}
define command{
command_name notify-host-by-ms-teams
command_line /usr/local/nagios/libexec/sendMSTeamsNotification.sh "$NOTIFICATIONTYPE$" "Host Alert: $HOSTNAME$ is $HOSTSTATE$"
}
The command could be configured even more, but meh..