Skip to content
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

Icingacli director kickstart run - error for slack_notification setup #31

Open
cherazo opened this issue Jun 9, 2020 · 7 comments
Open

Comments

@cherazo
Copy link

cherazo commented Jun 9, 2020

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,
‘client_dn’ => 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
Copy link

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
Copy link
Owner

nisabek commented Jun 9, 2020

Hi @cherazo,

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

  • Are you using the git master branch version? and
  • have you added the slack_notifications as custom string variable like described here ?

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
Copy link
Author

cherazo commented Jun 9, 2020

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
Copy link

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
Copy link
Owner

nisabek commented Jun 10, 2020

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
Copy link
Author

cherazo commented Jun 11, 2020

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
Copy link
Author

cherazo commented Jun 23, 2020

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,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants