Bug #2160

Invalid json output for tac.cgi

Added by prudnikov over 3 years ago. Updated 6 months ago.

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

100%

Category:Classic UI
Target version:Icinga 1.x - 1.7
Icinga Version:1.10.0 OS Version:any

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 Core, Classic UI, IDOUtils - Bug #2579: TAC.cgi json output invalid Rejected 05/04/2012

Associated revisions

Revision db6da796
Added by ricardo over 3 years ago

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

refs: #2160

Revision 65674be2
Added by ricardo about 3 years ago

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

refs: #2160

Conflicts:

Changelog

History

#1 Updated by ricardo over 3 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 3 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 3 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 3 years ago

Thanks!
This was fast!

#5 Updated by ricardo over 3 years ago

  • Status changed from New to Feedback

#6 Updated by ricardo about 3 years ago

  • Status changed from Feedback to Resolved

#7 Updated by dnsmichi about 3 years ago

  • % Done changed from 0 to 100

#8 Updated by dnsmichi 6 months ago

  • Project changed from 19 to Core, Classic UI, IDOUtils
  • Category set to Classic UI
  • Icinga Version set to 1.10.0
  • OS Version set to any

Also available in: Atom PDF