nisabek / icinga2-slack-notifications

Icinga2 notification integration with slack
Apache License 2.0
71 stars 36 forks source link

Icingacli director kickstart run - error for slack_notification setup #31

Open cherazo opened 4 years ago

cherazo commented 4 years ago

Hi Guys, Thanks for all the support en effort to maintain this project.

I'm trying to setup slack notifications and I got this error which I assume is part of the slack notification plugin.

I followed the how to and when I run icingacli director kickstart run I got this:

_root@icinga2:/usr/share/icingaweb2/modules/director# icingacli director kickstart run ERROR: RuntimeException in /usr/share/icingaweb2/modules/director/library/Director/Data/Db/DbObject.php:853 with message: Storing icinga_apiuser[] failed: SQLSTATE[23000]: Integrity constraint violation: 1048 Column ‘object_name’ cannot be null, query was: INSERT INTO icinga_apiuser (object_name, object_type, disabled, password, client_dn, permissions) VALUES (?, ?, ?, ?, ?, ?) {array ( ‘id’ => NULL, ‘object_name’ => NULL, ‘object_type’ => ‘external_object’, ‘disabled’ => ‘n’, ‘password’ => NULL, ‘clientdn’ => NULL, ‘permissions’ => NULL, )} Icinga + director works fine, email notifications, services, host, event handlers and more.

here is no any kickstart.ini file on /usr/share/icingaweb2/modules/director (my modules directory) but based on other post if you run the kickstart from the GUI at the beginning of icinga GUI setup... there is no need to run the icingacli director kickstart run. but this is part of the slack_notification setup as stated here:

Hi all,

Thanks for addressing this, and sorry for late response. I just got to try icinga-director, and in order for the director to recognize the changes in the icinga core I run the command icingacli director kickstart run

That should be run after the usual installation and final restart of the icinga2 service. After that the slack-notifications-command is visible in the command list of the icinga director, and if your hosts have the vars.slack_notifications = "enabled" set it will fire the notifications.

@lcorsini @meyerf99 - I would appreciate if you give it a try and report feedback.

Thanks and Regards, Nune

how I can make director can recognize the slack_notification command? is this affecting why slack_notification is not working?

Thanks in advance.

flaviomeyer commented 4 years ago

Hi @cherazo

I wrote a completely new slack add-on. I could publish this on GitHub the next few days and send you the link. The integration of @nisabek no longer worked for me with new Icinga2 Director versions.

nisabek commented 4 years ago

Hi @cherazo,

from the looks of it, the error has nothing to do with the plugin itself... I can only offer the following:

If @meyerf99 has a better add-on, and it truly requires a re-write and can't be fixed in this repo, I'd be happily including it in the docs for Director users.

Cheers, Nune

cherazo commented 4 years ago

Hi @cherazo

I wrote a completely new slack add-on. I could publish this on GitHub the next few days and send you the link. The integration of @nisabek no longer worked for me with new Icinga2 Director versions.

That would be awesome. Thank you.

@nisabek

The answer is "Yes" to both questions. The only issue is only with icingacli director kickstart run command.

Thanks

flaviomeyer commented 4 years ago

Hi @cherazo I wrote a completely new slack add-on. I could publish this on GitHub the next few days and send you the link. The integration of @nisabek no longer worked for me with new Icinga2 Director versions.

That would be awesome. Thank you.

@nisabek

The answer is "Yes" to both questions. The only issue is only with icingacli director kickstart run command.

Thanks

Hi @cherazo

I need to adjust my ReadMe for better understanding and then I will publish the script on GitHub. I'm hoping to get to it tomorrow or Friday. I will put the gist link in this issue post.

nisabek commented 4 years ago

There was a discussion about icinga director and slack notifications today in a DevOps slack...sounds like this plugin ...but who knows.. Maybe @cherazo you find it useful

Q: I'm setting up notifcations to slack.. and there is a part of the how to which state for the slack_notifications variable set to the host or services templates. Customizing to your environment To enable Slack notifications on a Host or Service, simply add the slack_notifications variable set to enabled to that object vars.slack_notifications = "enabled" You could do this at the template level as well to have your Host and Services inherit this property how do I set that variable at host or service level using director?

A: First define new boolean data field (edited) Then add the field to the host template and then you can change the value at host level

Hope this helps, Nune

cherazo commented 4 years ago

There was a discussion about icinga director and slack notifications today in a DevOps slack...sounds like this plugin ...but who knows.. Maybe @cherazo you find it useful

Q: I'm setting up notifcations to slack.. and there is a part of the how to which state for the slack_notifications variable set to the host or services templates. Customizing to your environment To enable Slack notifications on a Host or Service, simply add the slack_notifications variable set to enabled to that object vars.slack_notifications = "enabled" You could do this at the template level as well to have your Host and Services inherit this property how do I set that variable at host or service level using director?

A: First define new boolean data field (edited) Then add the field to the host template and then you can change the value at host level

Hope this helps, Nune

That was me on slack group lol. I'm looking help for all channels possible.

Thanks,

cherazo commented 4 years ago

Hi @cherazo I wrote a completely new slack add-on. I could publish this on GitHub the next few days and send you the link. The integration of @nisabek no longer worked for me with new Icinga2 Director versions.

That would be awesome. Thank you. @nisabek The answer is "Yes" to both questions. The only issue is only with icingacli director kickstart run command. Thanks

Hi @cherazo

I need to adjust my ReadMe for better understanding and then I will publish the script on GitHub. I'm hoping to get to it tomorrow or Friday. I will put the gist link in this issue post.

Hi @meyerf99 ,

Is there any update about this?

Thanks,