Page 1 of 1

Nagios-Slack webhook not sending alerts to Slack

Posted: Wed Apr 24, 2024 10:19 am
by pnikhade
Hi,

I am integrating slack with Nagios core to receive alerts and slack has a pretty simple mechanism called Incoming webhooks to achieve it. I had two separate scripts for getting slack host & service notifications under /usr/local/nagios/libexec directory. Both Nagios core & the client are RHEL EC2 instances.

On dry run for these two scripts they work perfectly, sending empty notifications to slack but actual alerts are not seen on slack. I am attaching the snip for both the files, please suggest where can I start troubleshooting for errors. I have no idea what's wrong going on here ?

Thanks,
Piyush

Re: Nagios-Slack webhook not sending alerts to Slack

Posted: Wed Apr 24, 2024 1:19 pm
by danderson
Thanks for reaching out @pnikhade,

Personally, I wouldn't post your Slack Hook on a public forum. Otherwise, I would make sure the URL is executable. Also it looks like the path you put in the command is /usr/lib64/nagios/plugins/slack_service_notify but it looks like it should be /usr/lib64/nagios/plugins/slack_service_notify.sh

Let me know if this helps

Re: Nagios-Slack webhook not sending alerts to Slack

Posted: Thu Apr 25, 2024 9:03 am
by pnikhade
Hi @danderson,

Thanks for your response, but whatever commands I defined in commands file is correct, please check the attached.

Please guide what I am doing wrong here.

Many Thanks,
Piyush
image_2024-04-25_193407694.png

Re: Nagios-Slack webhook not sending alerts to Slack

Posted: Thu Apr 25, 2024 10:21 am
by bbahn
Hello @pnikhade,

Have you checked your Nagios logs? Have you configured your hosts/services to utilize your defined commands?

Re: Nagios-Slack webhook not sending alerts to Slack

Posted: Thu Apr 25, 2024 11:05 am
by pnikhade
hi, this is resolved. One file was wrongly name which caused issue. Thanks !