-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to configure with icinga-director #5
Comments
I'll get to it this Friday, |
Hi, any update on this? |
Hi.. I did it on Director. I created Data Field slack_notifications and added it to host-template in Director and set it to "enabled" .. and added it to service-template in Director also with "enabled" .. It did the trick.. I had not modified hosts and service template file,s it is not necessary.. It was on icinga 2.7 and director 1.3.1 ( slightly newer then release.. It was taken from github repo in April ) |
Same here! |
Hi all, Thanks for addressing this, and sorry for late response. That should be run after the usual installation and final restart of the icinga2 service. @lcorsini @meyerf99 - I would appreciate if you give it a try and report feedback. Thanks and Regards, |
Hey @nisabek Thanks for your fast answer. I got this error with timeperiod.
Kind regards, |
It's possible to manage the custom attributes on host/service level through director. However configuring the other things isn't possible. Or at least I didn't find how. I added them to the configuration files. |
I've fixed my problem, but it was very hard. @nisabek Maybe u can documentation with timeperiod and icingaadmins group as prerequisite. Is it possible to test notifications? From my point of view, I have everything set up, but unfortunately I think no message in Slack. Kind regards, Flavio PS: In my Debug Log i see only this: I think thats false, coz all infos have null as string, is that right? |
In the meantime, I've actually reinstalled my infrastructure without director so I cannot really test this anymore in the short term. |
@nisabek I've fixed my problem. Set in Icinga Director Notification Interval to 60 and not 0. See this link in: https://monitoring-portal.org/woltlab/index.php?thread/41134-slack-notification-im-director-per-user-zuweisung/ |
seems like this is fixed. The current master contains the reference to a docker image that can be used for testing. |
It looks like it's still unclear how to configure the plugin in Icinga Director. Thanks! |
Sorry, I'm not using icinga2 anymore (different job) so can't help unfortunately. |
Can someone update this? Thanks! |
Interesting... |
After running the kickstart wizard in Icinga2 Director, is this the expected output for the NotificationCommand? I am unable to get any messages in my Slack channel. Below are from my debug logs:
|
@NC-Yungd can't verify right now, if that's the expected output, but I can tell you that those logs are not from the plugin(your grep is correct, just it matches some other lines...)...are you sure everything is enabled on the plugin side? |
@NC-Yungd A few weeks ago I have rebuilt the Slack notification. If I find time tomorrow I'il create a new gist and I'il let you know. |
Here are my current configurations: /etc/icinga2/zones.conf
/etc/icinga2/zones.d# tree -d
/etc/icinga2/zones.d/master/slack-notifications# cat slack-notifications-user-configuration.conf
In Icinga2 Director, I've created the custom variable for slack_notifications as a string. Afterwards, I've add ed slack_notifications as a field to my Host and Services template and included the string "enabled". |
hmm, from the fact that there are no logs of the plugin, I suppose that the slack_notifications variable is not understood by the director... Sorry I can't do more at the moment :/ |
@nisabek Initially, I installed this plugin by using the "Debian package" method, but after installing with git and copying the slack-notification conf files into my Icinga2 zones.d/master folder, I was able to get notifications in Slack. I'm going to assume that the Debian package is out-of-date since I wasn't able to get Slack notifications with Director. |
Thanks @NC-Yungd for getting back to us and making it work! https://github.com/nisabek/icinga2-slack-notifications#installation-using-debian-package If you feel like there's information missing regarding making it work on icinga director, I'd appreciate a a PR with more details. Thanks! Edit: updated wrong links. |
Hi there! Thanks for creating such a useful plugin. I recently installed icinga2 with icingaweb2 and director, and I need to integrate is to my company's slack. I've followed the howto and installed from git (and discovered a few mistakes in the howto), as suggested, but I cannot make it work. This is what I have done: ONE) Created a slack webhook and verified with curl that I do indeed get messages into the right channel. TWO) Logged into the icinga2 master machine as root, and
THREE) Customized /etc/icinga2/conf.d/templates.conf
FOUR) Customized /etc/icinga2/conf.d/icinga2-slack-notifications/slack-notifications-user-configuration.conf
FIVE) Enable Icinga2 debug logging SIX) Restarted icinga2 SEVEN) Triggered an alert by stopping a service, and verified that icingaweb2 shows the alert But I don't see any slack in the debug file. I have not configured anything in the director, because I'm new to Icinga2, and the discussions are not clear on what to do in what order. I don't have zones configured, do I need to? Can anyone please help? |
hi @guzaho and thanks for using the plugin question - does the service you stopped to test, use the generic-service template?... |
Hi @nisabek ! Thanks for the prompt reply! I do see plenty of logs in the debug.log. Actually, right before I saw your message now, I got a message in slack! Yay! It seems however, that I am only getting messages for the master node. The service I stopped is checked by check_systemd, and my service template looks like this in director: zones.d/director-global/service_templates.conf The service set that uses the service template is like this: apply Service "check_systemd" {
} So I guess it does not use the generic-service template? |
oh wait, that's a template on it's own, but do I see a typo?... |
ok, fixed the missing s zones.d/director-global/service_templates.conf |
and?...works?.. :) |
No, not for other hosts.. just the master... which does only use default services like apt, procs, etc. My nodes only use check_apt and check_procs, etc. The particular service I'm testing does not post any msgs to slack, it seems... |
alrighty that looks correct...questions
can you try that?... |
Of course, I can try! Thank you!
I am not sure which template the master node uses, it just showed up after installing icinga2, icingaweb2 and the director.. How can I check?
I have now also set the slack_notifications to enabled for the host, and it works!! |
Ok, so just to sum up, the missing piece what that misspelling that check_notifications should be in plural form, and that the hosts did not have the slack_notifications set to "enabled"! thank you so much! |
I looked through the docs again, and your configuration, and I don't seem to find if you have this piece somewhere
|
Hm, that's true. Where does that go? |
ah, ignore that, that's in the source code! so you must have checked it out :D my memory of the project is not that fresh sorry :) |
so - works now? |
Yes, looks like it. I'm gonna do some more testing, just in case. But all good for now! Thank you so much. 😄 |
awesome, enjoy! I really want to close this issue cause it's turned into debugging session of different issues. Anybody having trouble with icinga2 director configuration please refer to last part of the docs If that doesn't help - please open a new issue. And of course, contribute - with more docs, more tests, ...! ;) |
I've tried installing this component, but I'm stuck, since I'm using icinga-director.
I've installed and configured the deb package.
In icinga-director added the vars.slack_notifications to my hosts, but when I apply the config it says
critical/config: Error: Import references unknown template: 'slack-notifications-user-configuration-hosts' Location: in /etc/icinga2/conf.d/slack-notifications/slack-notifications-configuration.conf: 47:3-47:55 /etc/icinga2/conf.d/slack-notifications/slack-notifications-configuration.conf(45): /etc/icinga2/conf.d/slack-notifications/slack-notifications-configuration.conf(46): apply Notification "slack-notifications-notification-hosts" to Host { /etc/icinga2/conf.d/slack-notifications/slack-notifications-configuration.conf(47): import "slack-notifications-user-configuration-hosts" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
because director doesn't know anything about this new template
The text was updated successfully, but these errors were encountered: