Hi,
I am trying to pull comments out for hosts and services using a custom built webpage. This page uses jsonstatus.cgi to query Nagios and extract the required information to display in the format we prefer.
That is all working fine, but im struggling with how to extract the comments without resulting to screenscraping the host comment page via nagios/cgi-bin/extinfo.cgi?type=3
I was wondering if there are any parameters I can pass to extinfo.cgi to pull out the host/service defined if possible? all I get from the jsonstatus.cgi query is that the service has a comment assigned, it doesnt include what that comment actually said.
Hope that makes sense.
We are running Nagios Core 3.2.3
Thanks
Darren
How to query comments via URL extinfo.cgi
Re: How to query comments via URL extinfo.cgi
Scraping the comments from the extended cgi is probably the only option. You could take a look at the json branch of core 4 - it has a json api that can query object status and config, and historical information like previous check states and comments.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: How to query comments via URL extinfo.cgi
I decided to just grab the num_comments value from the object array of my json service query and add a symbol rather than grabbing the actual text.
This is a neater solution and simpler to code for our external dashboard.
This is a neater solution and simpler to code for our external dashboard.
Re: How to query comments via URL extinfo.cgi
Yes Please. Thanks for the quick responses