Skip to content
This repository has been archived by the owner. It is now read-only.

[dev.icinga.com #2473] add modified attributes row to extinfo.cgi showing diffs to original config #921

Closed
icinga-migration opened this issue Mar 28, 2012 · 9 comments

Comments

Projects
None yet
1 participant
@icinga-migration
Copy link
Member

commented Mar 28, 2012

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

Created by mfriedrich on 2012-03-28 16:20:23 +00:00

Assignee: mfriedrich
Status: Resolved (closed on 2012-04-24 15:06:00 +00:00)
Target Version: 1.7
Last Update: 2014-12-08 09:27:10 +00:00 (in Redmine)


modified attributes are more prior (set via webgui) than the original config, so the core will use those and override settings from original config.

normally, you don't see that in the gui. you'll only see e.g. that notifications are disabled, then rush into the config, see that they are not, wonder why, look into retention.dat, see modified attributes.

a better way of doing this would be to actually show this within the classic ui itsself in extinfo.cgi

thruk already does that here - http://thruk.org/advanced.html

Attachments

Changesets

2012-04-23 17:43:23 +00:00 by mfriedrich 1538f2d

classic ui: add modified attributes row to extinfo.cgi showing diffs to original config #2473 add modified attributes reset command to extinfo.cgi allowing to reset to original config #2474

unluckily a combined commit for both.

thing is that current objects contain the
modified_attributes, which is stored in
retention.dat by the core, plus written/read
to/from status.dat
the cgis did not have that as statusdata
defined, so changed that, now keeping the
status objects with another attribute.

ever since modified_attributes is a bitmask
we need to re-calculate that into a string.
printing it plain (json) and colored (html)
makes this another row in extinfo.cgi

while seeing the modified_attributes, one
might want to reset those - just changing
the values won't reset the modification
itsself.

problem - normally cmd.cgi would not allow
to send CHANGE_* commands. this is now
opened, but only for the MODATTR change cmds
as well es only allowing new cgi GET param
'attr' to bet set to 0 (reset, MODATTR_NONE).
other values will provoke an error on the
cmd.cgi not allowing you to send that cmd
to the core, in order to prevent XSS and such.

combined, this generates another valuable
enhancement for the Icinga Classic UI :)

(the idoutils database already got those
information, so Icinga Web can fetch them
already)

plus: adding modified_attributes to json
output for extinfo.cgi too

plusplus: new cmd.cgi GET param 'attr'

refs #2473
refs #2474

2012-04-24 06:59:49 +00:00 by mfriedrich 47b36d1

Changelog: add thx to Sven Nierlein for the idea of modified_attributes in classic ui

refs #2473
refs #2474

2012-04-24 14:55:59 +00:00 by ricardo b37cbf2

classi-ui: fixed some stuff in lost commit for modified attributes #2473, #2474

refs: #2473
refs: #2474

* added Changelog entry I forgot to add earlier
* removed compiler errors for extinfo.c and idoutils/logging.c
* added "Reset Modified Attributes" command to
  host and service command list in status.cgi
* remove left over line for debugging.

2012-04-24 21:56:46 +00:00 by ricardo 68c59b7

classic-ui: changed downtime->is_in_effect in extinfo to true/false #2473/#2474

refs: #2473
refs: #2474

* changed dispalying of downtime->is_in_effect to true/false
* removed a compile error

Relations:

@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Mar 28, 2012

Updated by mfriedrich on 2012-03-28 16:52:27 +00:00

temp_host|servicestatus
.modified_attributes

problem is that the cgis are not compiled with support to read that. requires a change in the statusdata structs the cgis require (breaks compatibility with other cores).

from include/objects.h

        unsigned long modified_attributes;

needs to be added to structs in onclude/statusdata.h

furthermore, xdata/xsddefault.c is required to read that information from status.dat as well. (writing already happens)

                        case XSDDEFAULT_HOSTSTATUS_DATA:
                                /* NOTE: some vars are not read, as they are not used by the CGIs (modified attributes, event handler commands, etc.) */
                                if (temp_hoststatus != NULL) {

...
                        case XSDDEFAULT_SERVICESTATUS_DATA:
                                /* NOTE: some vars are not read, as they are not used by the CGIs (modified attributes, event handler commands, etc.) */
                                if (temp_servicestatus != NULL) {

given that backend support, it should be easy to get the required information.

@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Mar 28, 2012

Updated by mfriedrich on 2012-03-28 16:52:41 +00:00

  • Status changed from New to Assigned
  • Assigned to set to mfriedrich
@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Apr 3, 2012

Updated by mfriedrich on 2012-04-03 15:02:36 +00:00

  • Target Version changed from 1.7 to 1.8
@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Apr 23, 2012

Updated by mfriedrich on 2012-04-23 14:37:43 +00:00

  • Target Version changed from 1.8 to 1.7

the difficult part is to parse the modified_attributes bitmask into a readable string, which is also possible so far. the rest is adaption of the cgi reading as outlined above.

@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Apr 23, 2012

Updated by mfriedrich on 2012-04-23 14:40:22 +00:00

  • File added icinga_classicui_1.7_extinfo_modified_attributes.png

icinga_classicui_1.7_extinfo_modified_attributes.png

@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Apr 23, 2012

Updated by mfriedrich on 2012-04-23 17:50:16 +00:00

  • Status changed from Assigned to Feedback
  • Done % changed from 0 to 90

currently in dev/cgis, please test!

@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Apr 24, 2012

Updated by ricardo on 2012-04-24 15:02:14 +00:00

looks good and works for me.

You can set this to "resolved"

@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Apr 24, 2012

Updated by mfriedrich on 2012-04-24 15:06:00 +00:00

  • Status changed from Feedback to Resolved
  • Done % changed from 90 to 100

okido, thanks for the code beautify!

@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Dec 8, 2014

Updated by mfriedrich on 2014-12-08 09:27:10 +00:00

  • Project changed from 19 to Core, Classic UI, IDOUtils
  • Category set to Classic UI
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.