sni / Thruk

Thruk is a multibackend monitoring webinterface for Naemon, Nagios, Icinga and Shinken using the Livestatus API.
http://www.thruk.org
Other
409 stars 149 forks source link

extinfo.cgi JSON support #1251

Closed infraweavers closed 1 year ago

infraweavers commented 1 year ago

Is your feature request related to a problem? Please describe. Under OMD 5, naemon has been changed to not write a state file anymore, this means that naemonstats does not work. It appears that the output in thruk contains the same information (check latency, number of hosts being checked etc). However the only way we have found to get this information on the command line is to use thruk 'extinfo.cgi?type=4 which does not seem to suppose &view_mode=xml or JSON. This means that we will have to parse HTML to get the information we require.

Describe the solution you'd like Make extinfo.cgi support view_mode

Describe alternatives you've considered We can re-enable the state file, however it seems like that is the wrong direction of travel; I can forsee this being removed completely at some point

Additional context

sni commented 1 year ago

Those json exports are a relict from times when there was no rest api. So now i would put something like this in the rest api. There is /services/stats, /hosts/stats, /processinfo and /processinfo/stats. Does any of those return the values you are looking for already?

infraweavers commented 1 year ago

Those json exports are a relict from times when there was no rest api. So now i would put something like this in the rest api. There is /services/stats, /hosts/stats, /processinfo and /processinfo/stats. Does any of those return the values you are looking for already?

Ahh! I did have a suspicion this would already exist, but my search skills were clearly lacking. This almost does what we want (not 100% that extinfo.cgi would necessarily give what we want either) as we have thruk pointing to 3 sites at current and we're trying to get the checklatency and number of hosts for a specific site.

~2 problems~ 1 problem I can see currently:

infraweavers commented 1 year ago

Aha, check latency is here checks/stats; yeah we can make this work. Cool thanks!

sni commented 1 year ago

It is also possible to add a /sites/ url prefix, see http://thruk.org/documentation/rest.html#_backends-sites