Nagios-Slack webhook not sending alerts to Slack

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.
Locked
pnikhade
Posts: 4
Joined: Thu Jul 27, 2023 10:23 am

Nagios-Slack webhook not sending alerts to Slack

Post 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
Attachments
slack_service-scripts.jpg
slack_host_script.jpg
User avatar
danderson
Posts: 117
Joined: Wed Aug 09, 2023 10:05 am

Re: Nagios-Slack webhook not sending alerts to Slack

Post 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
pnikhade
Posts: 4
Joined: Thu Jul 27, 2023 10:23 am

Re: Nagios-Slack webhook not sending alerts to Slack

Post 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
Last edited by pnikhade on Thu Apr 25, 2024 9:05 am, edited 1 time in total.
bbahn
Posts: 118
Joined: Thu Jan 12, 2023 5:42 pm

Re: Nagios-Slack webhook not sending alerts to Slack

Post by bbahn »

Hello @pnikhade,

Have you checked your Nagios logs? Have you configured your hosts/services to utilize your defined commands?
April: Actively advancing awesome answers with ardent alliteration, aptly addressing all ambiguities. Amplify your acumen and avail our amicable assistance. Eagerly awaiting your astute assessments of our advice.
pnikhade
Posts: 4
Joined: Thu Jul 27, 2023 10:23 am

Re: Nagios-Slack webhook not sending alerts to Slack

Post by pnikhade »

hi, this is resolved. One file was wrongly name which caused issue. Thanks !
Locked