Bug #2160

Invalid json output for tac.cgi

Added by prudnikov over 2 years ago. Updated almost 2 years ago.

Status:ResolvedStart date:12/06/2011
Priority:NormalDue date:
Assignee:ricardo% Done:

100%

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

Description

Observed in Icinga 1.5.1 and 1.6.0.
When calling tac.cgi with jsonoutput paramenter, the result is an invalid json.
In the end of the document commas are missing between fields:

"total_active_service_checks": 43,
"total_passive_service_checks": 0
"total_disabled_service_checks": 0
"total_active_service_checks_with_passive_disabled": 0
 }

Related issues

Related to Classic UI - Bug #2579: TAC.cgi json output invalid Rejected 05/04/2012

Associated revisions

Revision db6da796
Added by ricardo over 2 years ago

classic ui: fixed invalid json output for tac.cgi #2160

refs: #2160

Revision 65674be2
Added by ricardo almost 2 years ago

classic ui: fixed invalid json output for tac.cgi #2160

refs: #2160

Conflicts:

Changelog

History

#1 Updated by ricardo over 2 years ago

  • Assignee set to ricardo
  • Target version set to 1.7

sorry for the inconvenience, will have a look tonight

#2 Updated by dnsmichi over 2 years ago

if you need an 1.6.2, lemme know - if you find other serious bugs. make sure then to rebranch your tree to work on 1.6.x and 1.7.x tree.

#3 Updated by ricardo over 2 years ago

diff --git a/cgi/tac.c b/cgi/tac.c
index ae8c189..56aea71 100644
--- a/cgi/tac.c
+++ b/cgi/tac.c
@@ -1710,8 +1710,8 @@ void display_tac_overview(void) {
                printf("\"total_active_host_checks_with_passive_disabled\": %d,\n", total_active_host_checks_with_passive_disabled);

                printf("\"total_active_service_checks\": %d,\n", total_active_service_checks);
-               printf("\"total_passive_service_checks\": %d\n", total_passive_service_checks);
-               printf("\"total_disabled_service_checks\": %d\n", total_disabled_service_checks);
+               printf("\"total_passive_service_checks\": %d,\n", total_passive_service_checks);
+               printf("\"total_disabled_service_checks\": %d,\n", total_disabled_service_checks);
                printf("\"total_active_service_checks_with_passive_disabled\": %d\n", total_active_service_checks_with_passive_disabled);

                printf(" }\n");

This would be the patch if you compile from source.

Otherwise it would hit the next bugfix release.

#4 Updated by prudnikov over 2 years ago

Thanks!
This was fast!

#5 Updated by ricardo over 2 years ago

  • Status changed from New to Feedback

#6 Updated by ricardo about 2 years ago

  • Status changed from Feedback to Resolved

#7 Updated by dnsmichi almost 2 years ago

  • % Done changed from 0 to 100

Also available in: Atom PDF