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
Labels
blocker Blocks a release or needs immediate attention bug Something isn't working
Milestone

Comments

@icinga-migration
Copy link

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
Author

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
Author

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
Author

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
Author

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
Author

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
Author

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

  • Backport? changed from Not yet backported to Already backported

@icinga-migration icinga-migration added blocker Blocks a release or needs immediate attention bug Something isn't working libicinga labels Jan 17, 2017
@icinga-migration icinga-migration added this to the 2.4.2 milestone Jan 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker Blocks a release or needs immediate attention bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant