Hi Team,
I am integrating NagioXI with Slack. I have followed below document to integrate nagiosxi with slack.
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
When running below command on command prompt i am getting output in slack channel.
./slack_nagios.pl -field slack_channel=#hosts -field HOSTALIAS="Test Host" -field HOSTSTATE="UP" -field HOSTOUTPUT="Host is UP" -field NOTIFICATIONTYPE="RECOVERY"
But after complete the all steps on Ngaioxi UI, when services is changing its status it is not triggering any notification to slack. Please help ASAP.
NagioXI integration with Slack
Re: NagioXI integration with Slack
There are a lot of steps in that document so try to go over it again and make sure nothing was missed. If it is still not working after doing this, please PM a copy of the slack_nagios.pl as well as a profile from Admin > System Config > System Profile > Download Profile.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
romanshujain
- Posts: 8
- Joined: Mon Jan 21, 2019 8:44 pm
Re: NagioXI integration with Slack
I have followed all the steps mentioned in document correctly and reviewed it again.
Also, When i executed below command from terminal i am getting output in Slack (Page no 7). So It mean it is configured correctly.
./slack_nagios.pl -field slack_channel=#hosts -field HOSTALIAS="Test Host" -field HOSTSTATE="UP" -field HOSTOUTPUT="Host is UP" -field
NOTIFICATIONTYPE="RECOVERY"
PFA as requested.
Also, When i executed below command from terminal i am getting output in Slack (Page no 7). So It mean it is configured correctly.
./slack_nagios.pl -field slack_channel=#hosts -field HOSTALIAS="Test Host" -field HOSTSTATE="UP" -field HOSTOUTPUT="Host is UP" -field
NOTIFICATIONTYPE="RECOVERY"
PFA as requested.
You do not have the required permissions to view the files attached to this post.
-
npolovenko
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: NagioXI integration with Slack
@romanshujain, I see that you're monitoring 409 hosts and 2754 services with this XI but the slack contact is assigned to only 1 host -> eqwezp005. So it will only alert you if something happens with this specific host.
The second thing I noticed is that your commands (notify host by slack and notify service by slack) use the #general channel. But when you were running a test command you used the #hosts channel in slack?
Lastly, it doesn't look like you created a slack XI user. Please see page 10 of this tutorial:
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
The second thing I noticed is that your commands (notify host by slack and notify service by slack) use the #general channel. But when you were running a test command you used the #hosts channel in slack?
Lastly, it doesn't look like you created a slack XI user. Please see page 10 of this tutorial:
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
romanshujain
- Posts: 8
- Joined: Mon Jan 21, 2019 8:44 pm
Re: NagioXI integration with Slack
Thanks for the response.
1. Yes you are correct, I am monitoring many host and services but slack contact is assign only 1 host and 2 services because of testing purpose, I intentionally down those 2 services which are assigned slack contact but still it is not notify me on slack.
2. yes, I have created 2 commands(slack_host_notification_handler, slack_service_notification_handler) and they are using #general channel. Also, When i am executing command test command i put #general channel, In my previous post i forgot to mention it. Below is correct command.
./slack_nagios.pl -field slack_channel=#general-field HOSTALIAS="Test Host" -field HOSTSTATE="UP" -field HOSTOUTPUT="Host is UP" -field NOTIFICATIONTYPE="RECOVERY"
PS- commands(notify host by slack and notify service by slack) mentioned you are not present in my command.
3. I have created slack user. username is slack and name is Slack Integration.
Please let me know if any additional info required from my side.
1. Yes you are correct, I am monitoring many host and services but slack contact is assign only 1 host and 2 services because of testing purpose, I intentionally down those 2 services which are assigned slack contact but still it is not notify me on slack.
2. yes, I have created 2 commands(slack_host_notification_handler, slack_service_notification_handler) and they are using #general channel. Also, When i am executing command test command i put #general channel, In my previous post i forgot to mention it. Below is correct command.
./slack_nagios.pl -field slack_channel=#general-field HOSTALIAS="Test Host" -field HOSTSTATE="UP" -field HOSTOUTPUT="Host is UP" -field NOTIFICATIONTYPE="RECOVERY"
PS- commands(notify host by slack and notify service by slack) mentioned you are not present in my command.
3. I have created slack user. username is slack and name is Slack Integration.
Please let me know if any additional info required from my side.
Re: NagioXI integration with Slack
What do the permissions look like on the slack_nagios.pl file? Run "ll /usr/local/nagios/libexec/slack_nagios.pl" and make sure it's owned by nagios:nagios with executable permissions.
Are you waiting long enough for the service to go into a HARD state? The handler will only be triggered if it reaches a HARD state which can take up to 7 minutes based on the configuration.
Are you waiting long enough for the service to go into a HARD state? The handler will only be triggered if it reaches a HARD state which can take up to 7 minutes based on the configuration.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
romanshujain
- Posts: 8
- Joined: Mon Jan 21, 2019 8:44 pm
Re: NagioXI integration with Slack
slack_nagios.pl file is owned by nagios:nagios and permission are set as 775(rwxrwxr-x).
-rwxrwxr-x 1 nagios nagios 2712 Mar 11 15:17 slack_nagios.pl
Yes I am waiting enough for the service to go into a HARD state. I did schedule immediate check as well.
-rwxrwxr-x 1 nagios nagios 2712 Mar 11 15:17 slack_nagios.pl
Yes I am waiting enough for the service to go into a HARD state. I did schedule immediate check as well.
Re: NagioXI integration with Slack
Log into the slack account and make sure notifications are enabled on their account. See the attached screenshot.
You do not have the required permissions to view the files attached to this post.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.