Skip to content
This repository has been archived by the owner on Jan 15, 2019. It is now read-only.

[dev.icinga.com #3172] Add process status to JSON response #1120

Closed
icinga-migration opened this issue Sep 25, 2012 · 12 comments
Closed

[dev.icinga.com #3172] Add process status to JSON response #1120

icinga-migration opened this issue Sep 25, 2012 · 12 comments

Comments

@icinga-migration
Copy link

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

Created by ddegois on 2012-09-25 12:28:13 +00:00

Assignee: ricardo
Status: Resolved (closed on 2013-04-06 21:53:53 +00:00)
Target Version: 1.9
Last Update: 2014-12-08 09:27:36 +00:00 (in Redmine)


Hello,

It would be nice to integrate a warning in JSON output when the process seems to not have updated status since long time, like the warning message in red under the top-left block in the HTML version (where the version, the update message and button stands)

I thought about a think like that:

{
    "cgi_json_version": "1.8.0", 
    "status": {
        "service_status": [  ],
        "process_inactive_warning": 
    }
}

This should not break retro compatibility.

Regards,
D.

Changesets

2012-12-07 22:52:57 +00:00 by ricardo 6e7fac0

classic-ui: Added process status to JSON response #3172

refs: #3172

This will be added to every json response and gives the client
the possibility to warn the user if there is anything odd.

{ "cgi_json_version": "1.9.0",
"icinga_status": {
"status_data_age": 4,
"process_state_ok": true,
"reading_status_data_ok": true,
"program_version": "1.9.0dev",
"icinga_pid": 22883,
"timezone": "CET",
"program_start": 1354918801,
"total_running_time": "0d 0h 32m 44s",
"last_external_command_check": 1354920760,
"last_log_file_rotation": 0,
"notifications_enabled": true,
"disable_notifications_expire_time": 0,
"service_checks_being_executed": true,
"passive_service_checks_being_accepted": true,
"host_checks_being_executed": true,
"passive_host_checks_being_accepted": true,
"obsessing_over_services": true,
"obsessing_over_hosts": true,
"check_service_freshness": true,
"check_host_freshness": false,
"event_handlers_enabled": true,
"flap_detection_enabled": true,
"performance_data_being_processed": true
},

2013-02-06 23:18:44 +00:00 by ricardo 2d21977

classic-ui: added date_format to JSON status data #3172

refs: #3172

2013-02-06 23:55:48 +00:00 by ricardo 3e1e6d5

classic-ui: added status_update_interval to JSON status output #3172

refs: #3172

added "status_update_interval" and removed "program_state_ok" in
a earlier commit. was complete pointless

(O.o) (> <) Bunny approves these changes. #whatthecommit

Relations:

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2012-10-11 15:10:27 +00:00

  • Status changed from New to Feedback

i'd rather export the status file creation time (within a new name), in order to let apps decide their timezone offsets themselves - absolute unix timestamp.

@icinga-migration
Copy link
Author

Updated by ddegois on 2012-10-11 15:18:59 +00:00

Would you export it on each JSON as in HTML views ?
This might introduce side effect if monitoring device/computer/software time drifted.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2012-10-11 15:26:00 +00:00

i would remove the webservers time layer, which could be a possible source for errors.

@icinga-migration
Copy link
Author

Updated by ddegois on 2012-10-11 15:30:51 +00:00

It might be interesting to keep it, I've several Icinga instances running over several timezones. It's interesting to have local time while looking at issues.

Note that the warning display is relative, it just say how much second the status file is was not updated. This is absolutely time zone free and armored against sever <=> device time drift.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2012-10-24 17:56:28 +00:00

  • Target Version set to 1.9

@icinga-migration
Copy link
Author

Updated by ricardo on 2012-12-07 23:01:59 +00:00

  • Subject changed from Add a process status in JSON poll to Add process status to JSON response
  • Status changed from Feedback to 7
  • Assigned to set to ricardo
  • Done % changed from 0 to 80

in current dev/cgis.

these are the values which got added:

please test!!!

{ "cgi_json_version": "1.9.0",
"icinga_status": {
"status_data_age": 4,
"process_state_ok": true,
"reading_status_data_ok": true,
"program_version": "1.9.0dev",
"icinga_pid": 22883,
"timezone": "CET",
"program_start": 1354918801,
"total_running_time": "0d 0h 32m 44s",
"last_external_command_check": 1354920760,
"last_log_file_rotation": 0,
"notifications_enabled": true,
"disable_notifications_expire_time": 0,
"service_checks_being_executed": true,
"passive_service_checks_being_accepted": true,
"host_checks_being_executed": true,
"passive_host_checks_being_accepted": true,
"obsessing_over_services": true,
"obsessing_over_hosts": true,
"check_service_freshness": true,
"check_host_freshness": false,
"event_handlers_enabled": true,
"flap_detection_enabled": true,
"performance_data_being_processed": true
},

@icinga-migration
Copy link
Author

Updated by ddegois on 2012-12-07 23:56:18 +00:00

As prime view, it looks good, and python says it's valid json while the process is running but if I kill it, it gives me lot's of thing, in invalid format:

  • in the middle of the output, status element starts with:

    "status": {
    Content-type: text/json; charset="utf-8"\r\n
    \r\n
    { "cgi_json_version": "1.9.0",

I think it should not contains Content-type: text/json; charset="utf-8". It's like HTTP headers where finished twice (\r\n are actually CR LF while all the file is LF).

  • process_state_ok field still show true even if no process is running (did I misunderstand this field purpose ?)
  • error field (last field) contains unescaped " and line breaks.

Regards,
Damien

[Edit: I also have a message every time I start icinga: "_mcleanup: gmon.out: Permission denied" but doesn't seems to trouble anything.]

@icinga-migration
Copy link
Author

Updated by ricardo on 2012-12-18 17:04:50 +00:00

I know, but this is an actual bug. I open another Issue for this.

@icinga-migration
Copy link
Author

Updated by ricardo on 2012-12-20 23:51:42 +00:00

I hope I fixed the problem with #3507.

It's in current dev/cgis

Can you test it please?

thx

@icinga-migration
Copy link
Author

Updated by ddegois on 2012-12-20 23:58:52 +00:00

At a first glance it looks pretty good, thanks !

I'll test it a bit deeper this WE if I have time. I'll also start aNag integration :D

Regards,
Damien

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2013-04-06 21:53:53 +00:00

  • Category set to 78
  • Status changed from 7 to Resolved
  • Done % changed from 80 to 100

@icinga-migration
Copy link
Author

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

  • Project changed from 19 to Core, Classic UI, IDOUtils
  • Category changed from 78 to Classic UI

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant