Configure notification rules via REST API

Currently my workaround is:
Copying /omd/sites/local/etc/check_mk/conf.d/wato/notifications.mk after configuring the rule via webgui out of the checkmk docker container.
Then remove notifications.mk after starting:
rm /omd/sites/local/etc/check_mk/conf.d/wato/notifications.mk
Copy notifications.mk to /omd/sites/local/etc/check_mk/conf.d/wato/notifications.mk:
cp /srv/notifications.mk /omd/sites/local/etc/check_mk/conf.d/wato/notifications.mk
/srv/notifications.mk gets mounted at the start:

    volumes:
      - ${CHECKMK_CONFIG_DIR}/notifications.mk:/srv/notifications.mk

All of this is happening in deploy.sh after starting the docker container via a healthcheck, among many other REST API calls, which brought up this post.

1 Like