Notification error for custom script

That is because the environment variable NOTIFY_WHAT is not set when you call the script manually like you did. The same is true for all the other NOTIFY_* variables in your script.

But if the script gets called by checkmk to issue a notification, these variables are set to sensible values. For example, NOTIFY_WHAT will be set to either HOST or SERVICE depending on what caused the notification.

3 Likes