Where to add host_notification_commands & service_notification_commands?

Hi everyone!

I’m trying to run a bash script on a notification for a user, but I can’t seem to get it to trigger.

I tried adding the command in the command section of ./etc/nagios/conf.d/check_mk_templates.cfg and adding the contact to the contact section of the same file:

Contact:

define contact {
  name example-contact
  service_notification_period 24X7
  host_notification_period 24X7
  service_notification_options w,u,c,r,f,s
  host_notification_options d,u,r,f,s
  service_notification_commands notify-service-by-bash
  host_notification_commands notify-host-by-bash
  register 0
}

Command:

define command {
  command_name notify-host-by-bash
  command_line /opt/omd/sites/dc1/local/lib/nagios/plugins/send-bash-host.sh
}

define command {
  command_name notify-service-by-bash
  command_line /opt/omd/sites/dc1/local/lib/nagios/plugins/send-bash-service.sh

Can I just add the host_notification_commands & service_notification_commands to an existing user somehow? or any ideas why it won’t trigger?

Thanks for any help.

Thanks,
C

Found the answer here Notifications - via Email, SMS, Ticketsystems and more

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.