Page 1 of 1

@channel mention popup in slack channel #nagios not working.

Posted: Mon Dec 26, 2016 1:04 pm
by kaushalshriyan
Hi,

I am using the slack_nagios.pl perl script. I have integrated it with Nagios 4.2.0 to send notifications to Slack. Is there a way to setup @channel in https://raw.githubusercontent.com/tinys ... /nagios.pl perl script so that if there are any alert notifications it will pop up in the slack channel.

Settings in commands.cfg for sending alerts to slack are as below.

#'notify-service-by-slack' command definition
define command {
command_name notify-service-by-slack
command_line /usr/local/bin/slack_nagios.pl -field slack_channel=#nagios -field HOSTALIAS="$HOSTNAME$" -field SERVICEDESC="$SERVICEDESC$" -field SERVICESTATE="$SERVICESTATE$" -field SERVICEOUTPUT="$SERVICEOUTPUT$" -field NOTIFICATIONTYPE="$NOTIFICATIONTYPE$"
}

#'notify-host-by-slack' command definition
define command {
command_name notify-host-by-slack
command_line /usr/local/bin/slack_nagios.pl -field slack_channel=#nagios -field HOSTALIAS="$HOSTNAME$" -field HOSTSTATE="$HOSTSTATE$" -field HOSTOUTPUT="$HOSTOUTPUT$" -field NOTIFICATIONTYPE="$NOTIFICATIONTYPE$"

Any help will be highly appreciable. Please let me know if you need any additional information.

Regards,

Kaushal

Re: @channel mention popup in slack channel #nagios not work

Posted: Tue Dec 27, 2016 11:06 am
by dwhitfield
That script was written by someone or an organization called Tiny Speck. It's probably best to reach out to them for support for the script.

That said, we can leave this open for community feedback.

Re: @channel mention popup in slack channel #nagios not work

Posted: Wed Dec 28, 2016 1:53 am
by kaushalshriyan
Thanks dwhitfield for the reply.

Re: @channel mention popup in slack channel #nagios not work

Posted: Wed Dec 28, 2016 2:37 am
by rkennedy
I would take a look at the official slack integration to do this. https://slack.com/apps/A0F81R747-nagios