Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
I've got Nagios monitoring my servers via IPMI and it's working well. Now I'm trying to get it to send alerts through Slack. The instructions seem easy enough and when I run the scripts manually they do generate slack alerts. The issue is that Nagios doesn't automatically run the scripts when an alert is generated and I'm pretty sure it's because there's no slack user defined. When I try to define a user for slack the service fails to run
They are in the plugins folder /usr/local/nagios/libexec/
I also copied the slack.cfg file to /usr/local/nagios/etc/objects/ because I wasn't sure the plugins directory was the right place for it
What am I missing?
define contact {
contact_name nagiosadmin ; Short name of user
use generic-contact ; Inherit default values from generic-contact template (defined above)
alias Nagios Admin ; Full name of user
email nagios@localhost ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
}
###############################################################################
#
# CONTACT GROUPS
#
###############################################################################
# We only have one contact in this simple configuration file, so there is
# no need to create more than one contact group.
define contactgroup {
contactgroup_name admins
alias Nagios Administrators
members nagiosadmin,slack
}
If I understand correctly, the "slack_host_notify.sh" and "slack_service_notify.sh" scripts (from obaarne/Nagios2Slack) are now in your /usr/local/nagios/libexec folder.
The slack.cfg you posted, shows the path to the scripts in the command definitions going to /usr/local/bin/slack_nagios_service and /usr/local/bin/slack_nagios_host, instead of /usr/local/nagios/libexec
If you have not already, try changing the command_line(s) to the following...
The other thing I noticed, is that your argument list for slack_service_notify is a bit different than what obaarne/Nagios2Slack shows in the example. Here's a comparison of the arguments listed by obaarne/Nagios2Slack, vs yours for the slack_nagios_service.