This simple script makes use of the 'incoming webhook' connector in MS Teams. It will simply send a message stating that the server has either gone offline or online based on the last hard state of the host.
Internet access, Python 3, and the requests package are required.
Clone git repo:
git clone https://github.com/ajaffie/teams_connector.git
cd teams_connector
git tag -l
git checkout
Create webhook(s) in desired MS Teams channels and add the urls to the urls
list in config.json
.
For each webhook in config.json
, either put a "*" to include all notifications for that channel, or list the servers you want notifications to be sent to that channel for.
Optional: You can specify custom names for servers to use instead of "Server
Add NotificationCommand
definition and Notification
apply rules to your Icinga2/Nagios/etc. configurations.
Stop cluttering your inbox and instead annoy everyone in MS Teams!
(A NotificationCommand
definition is included, but you MUST change the path, as it uses a custom defined constant.)