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

[dev.icinga.com #10974] Modified attributes do not work for the IcingaApplication object w/ external commands #3843

Closed
icinga-migration opened this issue Jan 15, 2016 · 6 comments
Milestone

Comments

@icinga-migration
Copy link
Member

@icinga-migration icinga-migration commented Jan 15, 2016

This issue has been migrated from Redmine: https://dev.icinga.com/issues/10974

Created by ziesemer on 2016-01-15 05:57:20 +00:00

Assignee: mfriedrich
Status: Resolved (closed on 2016-01-21 18:10:03 +00:00)
Target Version: 2.4.2
Last Update: 2016-02-23 09:58:41 +00:00 (in Redmine)

Icinga Version: 2.4.1
Backport?: Already backported
Include in Changelog: 1

The global system states (Active/Passive Checks Enabled, Notifications Enabled, etc.) no longer remain persistent after a restart or reload in Icinga 2, as they did in Icinga 1.

Per-host and per-service states are persisting as expected, but not the global options.

To reproduce:

  • Disable notifications.
  • Restart Icinga.
  • Observe notifications are again enabled.

Changesets

2016-01-21 18:07:54 +00:00 by mfriedrich 730db0c

Fix: Modified attributes do not work for the IcingaApplication object w/ external commands

fixes #10974

2016-02-23 08:23:25 +00:00 by mfriedrich ec9caa4

Fix: Modified attributes do not work for the IcingaApplication object w/ external commands

fixes #10974
@icinga-migration
Copy link
Member Author

@icinga-migration icinga-migration commented Jan 21, 2016

Updated by mfriedrich on 2016-01-21 17:29:35 +00:00

  • Category set to libicinga
  • Status changed from New to Assigned
  • Assigned to set to mfriedrich
@icinga-migration
Copy link
Member Author

@icinga-migration icinga-migration commented Jan 21, 2016

Updated by mfriedrich on 2016-01-21 18:07:46 +00:00

  • Subject changed from Global system states not persisting after restart or reload. to Modified attributes do not work for the IcingaApplication object w/ external commands
  • Priority changed from Normal to High
  • Target Version set to 2.4.2

Most likely resulting from the change in #9859.

Values are correctly set (disabled host checks)

"status": {
"icingaapplication": {
"app": {
"enable_event_handlers": true,
"enable_flapping": true,
"enable_host_checks": false,
"enable_notifications": true,
"enable_perfdata": true,
"enable_service_checks": true,
"node_name": "mbmif.int.netways.de",
"pid": 92957,
"program_start": 1453397489.89886,
"version": "v2.4.1-125-g6ca054e"
}
}
}

Values are not stored in the state file:

111:{"name":"app","type":"IcingaApplication","update":{"type":"IcingaApplication","version":1446743344.7300889492}}

(which is perfectly fine, as we now have modified-attributes.conf. Though this is not written.)

The culprit is the way the external commands set the values - they need to call ModifyAttribute() on the Icingaapplication config object instead of directly modifying the Icingaapplication values.

We did not encounter that problem when implementing and testing the API actions since we moved that task to modifying the Icingaapplicakion object instead.

Working fix:

var obj = get_object("IcingaApplication", "app")
if (obj) {
        obj.modify_attribute("enable_flapping", false)
        obj.modify_attribute("enable_host_checks", false)
        obj.version = 1453399482.446963
}

Thanks for catching this! :)

@icinga-migration
Copy link
Member Author

@icinga-migration icinga-migration commented Jan 21, 2016

Updated by mfriedrich on 2016-01-21 18:10:03 +00:00

  • Status changed from Assigned to Resolved
  • Done % changed from 0 to 100

Applied in changeset 730db0c.

@icinga-migration
Copy link
Member Author

@icinga-migration icinga-migration commented Jan 21, 2016

Updated by ziesemer on 2016-01-21 19:07:16 +00:00

I'm happy to report, and thanks for the quick fix!

Similarly, would you maybe be able to take a quick pass at #10912 ? (From what I'm seeing, it looks like it was maybe just an incomplete commit that never should have hit the release?)

@icinga-migration
Copy link
Member Author

@icinga-migration icinga-migration commented Jan 21, 2016

Updated by mfriedrich on 2016-01-21 19:27:39 +00:00

Sorry, Icinga Web 2 is not really my story.

@icinga-migration
Copy link
Member Author

@icinga-migration icinga-migration commented Feb 23, 2016

Updated by gbeutner on 2016-02-23 09:58:41 +00:00

  • Backport? changed from Not yet backported to Already backported
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.