Notification Script for ntfy.sh

Hey,
I just wanted to exchange my custom notification script for the service ntfy.sh (open source push notification server):
CheckMK/notifcations at main · ADMIN-INTELLIGENCE-GmbH/CheckMK (github.com)
I hope you all like it and maybe can use it :wink:

7 Likes

Thanks for that notification plugin.

Just a quick remark regarding the installation: Customized code has to be put in the local hierarchy of the site. Notification plugins belong to $OMD_ROOT/local/share/check_mk/notifications. This way they survive a Checkmk update.

With the notification plugin in the local hierarchy you can then build an MKP and publish it on the Checkmk exchange.

3 Likes

Thank you for this hint.
I will take a look after it and will make some adjustments in the README.md

1 Like

Hi,
Thanks for the plugin! Took me some time but I got it working on our multi site installation.
What I had wrong: The script musst be copied to the remote site server as well!

Now, I have one more issue: the Link in the notification uses the site name of the remote site. I need this to be the name of the central site. Maybe you can add one more parameter or append the site name only it the URL doesn’t contain one (check for pattern ‘monitoring.example.com/site’) ?

Thanks in advance! :slight_smile:

I will look after it, but it could take a little while.

Update: You could just add more rules for this check and assign to a user on one of the multi sites. It is in number the third parameter wich had to be set.

I’ve changed the description now, thanks again for this hint.
Regarding the MKP I will look after it the next days.

Hi,

just to make sure:
Do you have a multisite were the configurations are pushed or is your config just to show the monitoring results?

If it will be pushed you should be fine in placing the script on the main server as every other server reports its states to the master.

Hi Sascha,
Thank you for sharing, I am still new to cmk, I try to follow your instructions and configure notfications. But it seems that it is not working properly and there is no successful trigger email, if you can guide me to the problem would be very grateful,

Some detail of my steps.

  1. copy the script to the folder and set it executable.
$OMD_ROOT/local/share/check_mk/notifications
`
2.Install ntfy server on Ubuntu 20.04. Enable Https. and add a admin user and set the user password.
I have test I can use the user and password to log the https://my-ntfy server successfully.
![image|690x352](upload://mp3ZpMQMp6BSUAliFy4gfA2NxzF.png)

3. 
![image|690x86](upload://vqIon2CtvDt3SWKSEV4zPT9ExQN.png)
For this part , 
NOTIFY_PARAMETER_1: myntfy server hostname
NOTIFY_PARAMETER_2:channel labopsCMK
NOTIFY_PARAMETER_3:http://mycheckmkserver/Site/
NOTIFY_PARAMETER_4:user
NOTIFY_PARAMETER_5:password

Thank you in advance,
BR,
Minghui.