Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dev.icinga.com #12464] API: events for DowntimeTriggered does not provide needed information #4504

Closed
icinga-migration opened this issue Aug 17, 2016 · 3 comments
Labels
area/api REST API bug Something isn't working
Milestone

Comments

@icinga-migration
Copy link

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

Created by dgoetz on 2016-08-17 11:57:28 +00:00

Assignee: mfriedrich
Status: Resolved (closed on 2016-08-17 14:57:56 +00:00)
Target Version: 2.5.0
Last Update: 2016-08-17 14:57:56 +00:00 (in Redmine)

Icinga Version: 2.4.10
Backport?: Not yet backported
Include in Changelog: 1

When I connect to the event stream the API provides for the Downtime there are three different types, but they do not exactly provide the information needed. I would like to get information about Downtimes starting and ending with the corresponding host/service.

DowntimeTriggered provides the following information:

{"downtime":{"entry_time":1471424893.1831400394,"legacy_id":1.0,"trigger_time":1471424893.1837849617,"triggers":[],"type":"Downtime","version":1471424893.1821451187,"was_cancelled":false},"timestamp":1471424893.183795929,"type":"DowntimeTriggered"}

If this would provide information on which host/service it was triggered, I would have the the starting information.

DowntimeAdded and DowntimeRemoved provides the following information:

{"downtime":{"__name":"test.localdomain!director.localdomain-1471431734-1","author":"icingaadmin","comment":"Test","config_owner":"","duration":0.0,"end_time":1471435379.0,"entry_time":1471431734.0314800739,"fixed":true,"host_name":"test.localdomain","legacy_id":2.0,"name":"director.localdomain-1471431734-1","package":"_api","scheduled_by":"","service_name":"","start_time":1471435319.0,"templates":["director.localdomain-1471431734-1"],"trigger_time":0.0,"triggered_by":"","triggers":[],"type":"Downtime","version":1471431734.0309131145,"was_cancelled":false,"zone":""},"timestamp":1471431734.0318291187,"type":"DowntimeAdded"}
{"downtime":{"__name":"test.localdomain!director.localdomain-1471431734-1","author":"icingaadmin","comment":"Test","config_owner":"","duration":0.0,"end_time":1471435379.0,"entry_time":1471431734.0314800739,"fixed":true,"host_name":"test.localdomain","legacy_id":2.0,"name":"director.localdomain-1471431734-1","package":"_api","scheduled_by":"","service_name":"","start_time":1471435319.0,"templates":["director.localdomain-1471431734-1"],"trigger_time":0.0,"triggered_by":"","triggers":[],"type":"Downtime","version":1471431734.0309131145,"was_cancelled":true,"zone":""},"timestamp":1471431887.6457719803,"type":"DowntimeRemoved"}

So DowntimeRemoved provides the information about ending downtimes because it will always trigger a remove event afterwards, but also if it is removed by other events.

So my preference would be adding the additional information to DowntimeTriggered and trigger an event during start and end of a downtime. This would allow to simply connect to one type and get all required information.

Changesets

2016-08-17 14:57:22 +00:00 by mfriedrich e5566a6

API: Fix missing attributes for DowntimeTriggered event

fixes #12464
@icinga-migration
Copy link
Author

Updated by mfriedrich on 2016-08-17 11:59:21 +00:00

  • Tracker changed from Feature to Bug
  • Icinga Version set to 2

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2016-08-17 14:57:15 +00:00

  • Status changed from New to Assigned

  • Assigned to set to mfriedrich

  • Target Version set to 2.5.0

    michi@mbmif ~/coding/icinga/icinga2 (master) $ curl -k -s -u root:icinga -H 'Accept: application/json' -X POST 'https://localhost:5665/v1/events?queue=f&types=DowntimeTriggered'
    {"downtime":{"__name":"mbmif.int.netways.de!test!mbmif.int.netways.de-1471445794-0","author":"icingaadmin","comment":"dfsfs","config_owner":"","duration":7200.0,"end_time":1471449389.0,"entry_time":1471445794.4635159969,"fixed":false,"host_name":"mbmif.int.netways.de","legacy_id":3.0,"name":"mbmif.int.netways.de-1471445794-0","package":"_api","scheduled_by":"","service_name":"test","start_time":1471445789.0,"templates":["mbmif.int.netways.de-1471445794-0"],"trigger_time":1471445794.4698870182,"triggered_by":"","triggers":[],"type":"Downtime","version":1471445794.4638500214,"was_cancelled":false,"zone":""},"timestamp":1471445794.4711410999,"type":"DowntimeTriggered"}

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2016-08-17 14:57:56 +00:00

  • Status changed from Assigned to Resolved
  • Done % changed from 0 to 100

Applied in changeset e5566a6.

@icinga-migration icinga-migration added bug Something isn't working area/api REST API labels Jan 17, 2017
@icinga-migration icinga-migration added this to the 2.5.0 milestone Jan 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api REST API bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant