Bug #2343

JSON output for comments and downtimes in extinfo.cgi sometimes invalid

Added by xav about 2 years ago. Updated about 2 years ago.

Status:ResolvedStart date:02/22/2012
Priority:NormalDue date:
Assignee:ricardo% Done:

100%

Category:Export
Target version:Icinga 1.x - 1.7
Icinga Version: Browser Version:

Description

Hi,

JSON comments export doesn't seem to output valid JSON code when there is one or more services comment and no host comment.

Version used : 1.6.1

Here is an example :


{ "cgi_json_version": "1.6.0",
"extinfo": {
"comments": [
,
{ "host_name": "dummy-host", "service_description": "Dummy Service", 
"comment_type": "SERVICE", "entry_time": "2012-02-22 10:34:43", "author": "admin", 
"comment": "test", "comment_id": 119, "persistent": false, "comment_type": "Acknowledgement", "expires": "1970-01-01 01:00:00" }
]
}
}

There is an additional comma which seems to is the issue.

Associated revisions

Revision 582ff404
Added by ricardo about 2 years ago

classic ui: fixed json output for comments and downtimes in extinfo.cgi sometimes invalid #2343

refs: #2343

  • changes array names in json output of extinfo.c
    comments -> host_comments / service_comments
    downtimes -> host_downtimes / service_downtimes

Revision 7b9ec5bf
Added by ricardo about 2 years ago

classic-ui: updated Changelog CHANGES section

refs: #1524
refs: #1981
refs: #2018
refs: #2117
refs: #2119
refs: #2145
refs: #2198
refs: #2343
refs: #2359
refs: #2373
refs: #2421

hope the "changes" section for classic ui isn't tooo long

Revision 11ae7d32
Added by ricardo almost 2 years ago

classic ui: fixed json output for comments and downtimes in extinfo.cgi sometimes invalid #2343

refs: #2343

  • changes array names in json output of extinfo.c
    comments -> host_comments / service_comments
    downtimes -> host_downtimes / service_downtimes

Conflicts:

Changelog
Changelog_json

History

#1 Updated by ricardo about 2 years ago

  • Assignee set to ricardo
  • Target version set to 1.7

Hi,

I'll have a look at it.

#2 Updated by ricardo about 2 years ago

  • Subject changed from JSON comments output not valid to JSON output for comments and downtimes in extinfo.cgi sometimes invalid
  • Status changed from New to Feedback
  • % Done changed from 0 to 100

fixed in current git "rbartels/cgi".

!!! Array names have changed:

    comments  -> host_comments  / service_comments
    downtimes -> host_downtimes / service_downtimes

please test if this works for you

#3 Updated by ricardo about 2 years ago

  • Status changed from Feedback to Resolved

Added note to changes in Changelog and to Changelog_json

Also available in: Atom PDF