URL对象json NAGIOS

我有一个问题,我使用许多监控网络,如果你知道 PRTG </ code>你 可以创建一个返回各种传感器和警报消息状态的URL,并在不同的Web图形页面中处理此信息; 现在我被要求做同样的事情,但是使用工具他们会听到 NAGIOS </ code>进程吗? 我不明白它应该如何构建URL如果alguin使用它我会很感激帮助我。</ p>

PRTG的示例URL </ code>:</ p>

 <代码> https://10.213.8.25/api/table.json?content=sensors&amp;output=json&amp;columns=status,message&amp;filter_status=4&amp;filter_objid=9336&amp;filter_objid=9495&amp;filter_objid=  9496 
</代码> </ PRE>

返回:</ p>

 <代码> { “PRTG版本”: “:”, “的TreeSize”:000  ,“传感器”:[{“objid”:1001 .....}]} 
</ code> </ pre>
</ div>

展开原文

原文

I have a question, I work with many monitoring web, if you know PRTG you can make a URL that returns the status of the various sensors and alarm messages, and process this information in different web graphic pages; Now I have been asked to do the same but with the tool Will they hear the NAGIOS process? I do not understand how it should build the URL if alguin worked with this I would appreciate help me.

Example URL with PRTG:

https://10.213.8.25/api/table.json?content=sensors&output=json&columns=status,message&filter_status=4&filter_objid=9336&filter_objid=9495&filter_objid=9496

Return:

{"prtg-version":":","treesize":000,"sensors":[{"objid":1001.....}]}

ds122455
ds122455 核心nagios?不。如果您使用的是Check_MK或OMD,则可以调用livestatusAPI。我使用这个库:github.com/aashley/nagios-livestatus-client
接近 5 年之前 回复

1个回答



您可以从Nagios Core版本 4.0.7 </ strong>开始获取JSON。
只需浏览 < 代码> http://&lt; address_of_your_nagios_server&gt; /nagios/jsonquery.html </ code> </ strong>
您将找到一个 JSON查询生成器</ strong>页面,可以帮助您构建查询URL ,执行它,并获得JSON结果。 执行查询后,在页面的右侧,将生成生成的URL,并在其下方显示查询结果。 您可以将生成的URL粘贴到浏览器中或从应用程序调用以获取原始JSON。</ p>

有关此功能的更多信息,请访问: https:// labs。 nagios.com/2014/06/19/exploring-the-new-json-cgis-in-nagios-core-4-0-7-part-1/ </ p>
</ div>

展开原文

原文

You can get JSON starting with Nagios Core version 4.0.7. Just browse to http://<address_of_your_nagios_server>/nagios/jsonquery.html and you'll find a JSON Query Generator page that can help your build your query URL, execute it, and get JSON results. After executing the query, on the right-hand side of the page, the generated URL will be given and below it, the results of the query. You can paste the generated URL into a browser or call from your application to get raw JSON.

More information on this feature can be found here: https://labs.nagios.com/2014/06/19/exploring-the-new-json-cgis-in-nagios-core-4-0-7-part-1/

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问