A Nagios plugin to send notifications to MS teams

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
Wojtek
Posts: 17
Joined: Fri Sep 07, 2018 4:51 am

A Nagios plugin to send notifications to MS teams

Post by Wojtek »

Microsoft Teams is becoming more and more popular and nowhere do I see descriptions of how to make a notification to MS Teams.

I found this plugin https://exchange.nagios.org/directory/P ... ms/details and I tested it in the command line.

When I test the command I have notification on channel in MS Teams

export NAGIOS_HOSTALIAS="hoge101" NAGIOS_SERVICEDESC="http" NAGIOS_SERVICESTATE="WARNING" NAGIOS_SERVICEOUTPUT="test output"
./nagios-msteams.pl --webhook 'https://outlook.office.com/webhook/xxx' I have notofication in MS Teams channel

Now I have problem with configure commands and contacts.

I use manual https://assets.nagios.com/downloads/nag ... ios-XI.pdf and compare with this one https://assets.nagios.com/downloads/nag ... ios-XI.pdf but it is not clearly for me.

How I can define commands and appropriate services for this notification? Any ideas?

Best wishes
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: A Nagios plugin to send notifications to MS teams

Post by lmiltchev »

This is a 3rd party plugin that is not developed or maintained by us (Nagios), so it is out of scope of Nagios support. Having said that, here's what you could try:

1. Go to the CCM > Commands > Add New, and add 2 new commands - "msteam_host_notification_handler" and "msteam_service_notification_handler". I am not familiar with the plugin, so I am not sure if this is going to work, but you could try using the same command line for both commands:

Code: Select all

export NAGIOS_HOSTALIAS="hoge101" NAGIOS_SERVICEDESC="http" NAGIOS_SERVICESTATE="WARNING" NAGIOS_SERVICEOUTPUT="test output" $USER1$/nagios-msteams.pl --webhook 'https://outlook.office.com/webhook/xxx'
provided you copied over the nagios-msteams.pl plugin in the libexec directory.

2. Change the "default" notification handlers (commands) on a test contact by going to the CCM > Contacts > <your contact> > Alert Settings > Manage Host/Service Notification Commands, and select the two commands you created in step 1 ("msteam_host_notification_handler" for hosts, and "msteam_service_notification_handler" for services).

3. Add the contact to your host/service, and see if you are going to receive a notification when the host/service changes to HARD non-ok state.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked