Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
[dev.icinga.com #5217] status output in JSON format not including short and long plugin output properly #1396
This issue has been migrated from Redmine: https://dev.icinga.com/issues/5217
Created by ddegois on 2013-11-26 11:03:05 +00:00
It would be nice to have a configuration option to add LONGSERVICEOUTPUT properly escaped in a new fiels of service status overview's JSON output (http://classic.demo.icinga.org/icinga/cgi-bin/status.cgi?host=all&type=detail&servicestatustypes=16&serviceprops=1048576&jsonoutput), no ?
2013-12-03 11:22:27 +00:00 by ricardo 7999005
2013-12-03 15:28:55 +00:00 by ricardo b430bb8
2013-12-04 21:15:09 +00:00 by ricardo 19307be
2013-12-04 21:29:21 +00:00 by ricardo 265ebfa
2013-12-13 12:50:34 +00:00 by ricardo 8e18f34
Updated by ricardo on 2013-11-26 19:04:14 +00:00
you can get this behavior by splitting the string after the first line break if there is any.
status_information "Connection refused\nSMTP CRITICAL - 0.023 sec. response time\ntest123"
$SERVICEOUTPUT$ = Connection refused
And isn't it usually properly escaped?
Updated by ddegois on 2013-11-27 01:21:29 +00:00
I agree but currently, in style=servicedetail or style=hostdetail, status_information contains serviceoutput, not longserviceoutput :)
My suggestion was to add a dedicated key for longserviceoption to avoid breaking compatibility with older softwares and while improving overviews.
My point of view is, as JSON output is more software/API and mostly non-human-reading oriented, to have maximum information in minimum of request might be a good idea, (personal opinion :D ).
Updated by ricardo on 2013-12-02 22:55:59 +00:00
In both styles it contains the longserviceoutput (as described in previous post) )as long as you have the cgi.cfg option "status_show_long_plugin_output" switched to 1.
Updated by ddegois on 2013-12-02 23:33:22 +00:00
I've spotted a subtle difference between HTML output and JSON output (on status.cgi in search mode or overview). It seems that on JSON, only the second line is shown.
In HTML table, the Status information call contains:
On the JSON output, the "status_information" key contains only the second line:
Did I miss something ?
Updated by mfriedrich on 2013-12-03 08:01:24 +00:00
long output is always considered the 2..n lines of the output. the html formatting just presents the \n in a familiar manner (
not only the cgis behave that way, also the internal column attributes are populated like so.
Updated by ricardo on 2013-12-03 10:26:50 +00:00
Stage 5 and 6 now ;-)