We have a script that works when ran from the cli. Along with the script, we have configured user accounts and groups that will be notified. Those notifications should trigger a new, custom notification that we have defined in the commands.cfg file (imported through the web portal and verified to be there when configuration applied and core restarted).
Here are the commands:
Code: Select all
define command {
command_name notify-service-by-slack
command_line /usr/local/bin/slack_nagios.sh > /tmp/slack.log 2>&1
}
define command {
command_name notify-host-by-slack
command_line /usr/local/bin/slack_nagios.sh > /tmp/slack.log 2>&1
}
Code: Select all
define contact {
contact_name slack
alias Slack
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,r
service_notification_commands notify-service-by-slack
host_notification_commands notify-host-by-slack
}
define contactgroup{
contactgroup_name admins
alias Nagios Administrators
members root,slack
}
define contactgroup{
contactgroup_name admins-page
alias Nagios Administrators
members root,slack
}VMware VM - built from OVA/OVF from Nagios