I can't get a custom script to run as a notification

CMK version: 2.3.0
OS version: Ubuntu 22.04.5 LTS + Docker version 28.0.1

Hi!

I come from Nagios and wanted to migrate everything to checkmk, both at home and at work, but I’m having a problem with Telegram notifications.

I run checkmk in a Docker container with this configuration:

services:
  checkmk:
    image: checkmk/check-mk-raw:2.3.0-latest
    container_name: checkmk
    ports:
      - "8888:5000"
      - "8000:8000"
    volumes:
      - ./monitoring:/omd/sites
      - /etc/localtime:/etc/localtime:ro
    tmpfs:
      - /opt/omd/sites/cmk/tmp:uid=1000,gid=1000
    restart: unless-stopped
    tty: true
    stdin_open: true

I created a .sh script in cmk/local/share/check_mk/notifications/telegram_notification.sh and it appears in the list to create a new notification. The content of the script doesn’t matter because it never runs. I’ve tried curl, touch, echo > file, etc.

All file permissions and ownership are correct, and if I run the script from within the container with the cmk user it runs without problems.

I have created the new notification as you can see in the screenshot.

Now I hit “test notifications” and get this:

I have also tried from “fake check results” in several services, and the script does not run either.

notify.log:

What else could I review?

Thank you very much in advance.

Here you also only see a test of the notification rules. How does it look like with a real notification? You said that you tried a fake check result and this was also not working. With fake check result you need to consider the needed checks until you reach a hard state for the notification.

All the other settings should be correct.

Thanks for the reply. Now the script is running with real events, so I probably still don’t quite understand how checkmk works.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.