Icinga / icingaweb2

A lightweight and extensible web interface to keep an eye on your environment. Analyse problems and act on them.
https://icinga.com/get-started/
GNU General Public License v2.0
810 stars 282 forks source link

impossible to export an event in json with icingaweb2 #5261

Closed fdumont35 closed 2 months ago

fdumont35 commented 2 months ago

Describe the bug

Hi, for an application, I want to automatically retrieve the entire content of the output field of an old event. image

I can't do that with icinga2 api. With icingaweb2 / eventhistory I have only the first line of the Output field. So I try with this path : XXX/icingaweb2/monitoring/event/show?type=hard_state&id=22790006&format=json but json export does not work. It is ok with pdf, but not with json and csv format. Can you fix this ?

To Reproduce

Try to get json response with postman of in a web browser

Your Environment

Program Version | r2.14.2-1

Thank you for your help

nilmerg commented 2 months ago

Hi,

I'd rather suggest to use Icinga DB Web's export functionality as basis for your app.

The monitoring module will not receive such an addition anymore.

fdumont35 commented 2 months ago

Hi Nilmerg, It is not possible de add a parameter to icingaweb2/monitoring/list/eventhistory to export in json not only the first line, but all the content of output field ?

nilmerg commented 2 months ago

Possible, probably. Worth the effort, not really. :wink:

fdumont35 commented 2 months ago

Thank you for your response, one last question : Do you know why the json export for path icingaweb2/monitoring/event/show is not working ? Is it a problem on our side or global to icinga r2.14.2-1 ? You will not plan to fix this ?

nilmerg commented 2 months ago

The reason is, it is not implemented. In Icinga Web 2. (Specifically, the monitoring module) Icinga DB Web is the successor of the monitoring module, hence why I'm suggesting you to switch.