status.dat is easy to parse, which make it a good choice to share between nagios and other programs/systems.<br><br>I see this(thin version of statusXML.php: <a href="http://svn.jasonantman.com/nagios-xml/statusXML-krzywanski.php">http://svn.jasonantman.com/nagios-xml/statusXML-krzywanski.php</a>), and this(c version of nagios-xml: <a href="http://svn.jasonantman.com/nagios-xml/php_module/">http://svn.jasonantman.com/nagios-xml/php_module/</a>), which maybe more usefull for light-weight or high-performance purpose.<br>
<br><div class="gmail_quote">On Tue, May 8, 2012 at 12:09 PM, Wenhua Zhang <span dir="ltr"><<a href="mailto:shiziwen@gmail.com" target="_blank">shiziwen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Mike,<br>
Thanks for your information.<br>
If the new version support the API's for XML and JSON, I think it will<br>
be very useful for many people.<br>
I am looking forward to the new revision.<br>
<br>
Best Wishes,<br>
Wenhua<br>
<br>
<br>
2012/5/7 Mike Guthrie <<a href="mailto:mguthrie@nagios.com">mguthrie@nagios.com</a>>:<br>
<div class="HOEnZb"><div class="h5">> As a side note it looks like there is already an addon that's been<br>
> written that produces the status data in XML format.<br>
><br>
> <a href="http://exchange.nagios.org/directory/Addons/APIs/XML/Status-XML-Generator/details" target="_blank">http://exchange.nagios.org/directory/Addons/APIs/XML/Status-XML-Generator/details</a><br>
><br>
><br>
> Although they won't be making it into the 3.4 release, we'll be looking<br>
> at incorporating community developed API's for XML and JSON in the next<br>
> revision of Nagios core since there has been quite a bit of interest in it.<br>
><br>
><br>
> On 5/6/2012 8:05 PM, Wenhua Zhang wrote:<br>
>> Hi Robert,<br>
>> Thanks for your advice, it is a good idea.<br>
>><br>
>> As till now, status-txt just returns status.dat as plain text. When we<br>
>> wrote this program, we have thought about many formats, such as JSON,<br>
>> XML, plain text and so on. We use plain text because it is simple, but<br>
>> now I found it may be not widely used as JSON and XML. (status-json<br>
>> can get the nagios data as JSON. You can get it from<br>
>> <a href="http://exchange.nagios.org/directory/Addons/APIs/JSON/status-2Djson/details" target="_blank">http://exchange.nagios.org/directory/Addons/APIs/JSON/status-2Djson/details</a>)<br>
>><br>
>> status-txt is the first version, and we will add more function in the<br>
>> next version, such as more filters and maybe more output formats.<br>
>><br>
>> I think you can push your PHP program to the this email list, maybe<br>
>> some one will be interested, like me.<br>
>><br>
>> Best Wishes,<br>
>> Wenhua<br>
>><br>
>><br>
>> 2012/5/6 Robert Arends<<a href="mailto:rarends@imc.net.au">rarends@imc.net.au</a>>:<br>
>>> Sounds great. Does it output in XML ? Would be good to support that as an option.<br>
>>> It would be good to have a search option - as in , return all hosts/services/downtime etc matching ".....". If it could do regex on the match would be nice.<br>
>>><br>
>>> I've just written a rough php program to return status.dat as XML.<br>
>>> It works very well but C++ would be quicker and I wouldn't have to cleanup the code.<br>
>>><br>
>>> I'll run this up during the week to see if it is a good as it sounds like it is.<br>
>>><br>
>>> Thanks rob<br>
>>><br>
>>><br>
>>><br>
>>> Sent from my iWorld<br>
>>><br>
>>> On 06/05/2012, at 2:08, "Wenhua Zhang"<<a href="mailto:shiziwen@gmail.com">shiziwen@gmail.com</a>>  wrote:<br>
>>><br>
>>>> Thanks for your reply!<br>
>>>> I hope it will be useful to you.<br>
>>>> It is the first version and we will add more functions. If you have<br>
>>>> some advice, please feel free to let me know.<br>
>>>><br>
>>>> Thanks,<br>
>>>> Best Wishes,<br>
>>>> Wenhua<br>
>>>><br>
>>>> 2012/5/5 Alex Griffin<<a href="mailto:agriffin@nagios.com">agriffin@nagios.com</a>>:<br>
>>>>> Thanks for posting this, it looks pretty useful!<br>
>>>>><br>
>>>>> Alex Griffin<br>
>>>>> ---<br>
>>>>> Tech Team<br>
>>>>> <a href="mailto:agriffin@nagios.com">agriffin@nagios.com</a><br>
>>>>><br>
>>>>> On 05/02/2012 10:57 PM, Wenhua Zhang wrote:<br>
>>>>>> Hi all,<br>
>>>>>> Recently, we need a API or application to get the nagios data as other<br>
>>>>>> easily readable format such as XML, JSON or plain text instead of the<br>
>>>>>> default HTML.<br>
>>>>>> status-txt is implemented to duplicate the output of status.cgi in<br>
>>>>>> plain text to achieve this goal, making it easier for other<br>
>>>>>> applications/services to use Nagios data.<br>
>>>>>><br>
>>>>>> Compile status-txt.c to create status-txt.cgi, this cgi accepts<br>
>>>>>> exactly the same URL parameters that status.cgi accepts, and filters<br>
>>>>>> its output appropriately.<br>
>>>>>> In this version, it accepts almost all the arguments passed in the URL<br>
>>>>>> which status.cgi accepts except "style", "navbarsearch", "columns" and<br>
>>>>>> "noheader".<br>
>>>>>> And we will add more functionalities in the next version.<br>
>>>>>><br>
>>>>>> The status-txt.cgi will returns service data that appears in the<br>
>>>>>> "status" table of status.cgi as "host_ip   host_status<br>
>>>>>> [service:service_status;......]", not includes the top portion of the<br>
>>>>>> page, eg:<br>
>>>>>>      196.0.0.1      UP    HTTP_80:OK;<br>
>>>>>>      196.0.0.2      UP    DB_PORT_3306:OK;DB_PORT_3307:OK;<br>
>>>>>> And you can use some arguments to filter its output, such as<br>
>>>>>> "hostgroup", "servicegroup", "host" and so on.<br>
>>>>>><br>
>>>>>> The attachment is the source code, if you have any ideas about it,<br>
>>>>>> please feel free to let me know.<br>
>>>>>> You can also get the source code from github<br>
>>>>>> "<a href="https://github.com/shiziwen/nagios-status2txt" target="_blank">https://github.com/shiziwen/nagios-status2txt</a>".<br>
>>>>>><br>
>>>>>><br>
>>>>>> Thanks,<br>
>>>>>> Best Wishes,<br>
>>>>>> Wenhua<br>
>>>>>><br>
>>>>>><br>
>>>>>><br>
>>>>>> ------------------------------------------------------------------------------<br>
>>>>>> Live Security Virtual Conference<br>
>>>>>> Exclusive live event will cover all the ways today's security and<br>
>>>>>> threat landscape has changed and how IT managers can respond. Discussions<br>
>>>>>> will include endpoint security, mobile security and the latest in malware<br>
>>>>>> threats. <a href="http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/" target="_blank">http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/</a><br>
>>>>>><br>
>>>>>><br>
>>>>>><br>
>>>>>> _______________________________________________<br>
>>>>>> Nagios-users mailing list<br>
>>>>>> <a href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</a><br>
>>>>>> <a href="https://lists.sourceforge.net/lists/listinfo/nagios-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-users</a><br>
>>>>>> ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.<br>
>>>>>> ::: Messages without supporting info will risk being sent to /dev/null<br>
>>>>> ------------------------------------------------------------------------------<br>
>>>>> Live Security Virtual Conference<br>
>>>>> Exclusive live event will cover all the ways today's security and<br>
>>>>> threat landscape has changed and how IT managers can respond. Discussions<br>
>>>>> will include endpoint security, mobile security and the latest in malware<br>
>>>>> threats. <a href="http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/" target="_blank">http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/</a><br>
>>>>> _______________________________________________<br>
>>>>> Nagios-users mailing list<br>
>>>>> <a href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</a><br>
>>>>> <a href="https://lists.sourceforge.net/lists/listinfo/nagios-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-users</a><br>
>>>>> ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.<br>
>>>>> ::: Messages without supporting info will risk being sent to /dev/null<br>
>>>> ------------------------------------------------------------------------------<br>
>>>> Live Security Virtual Conference<br>
>>>> Exclusive live event will cover all the ways today's security and<br>
>>>> threat landscape has changed and how IT managers can respond. Discussions<br>
>>>> will include endpoint security, mobile security and the latest in malware<br>
>>>> threats. <a href="http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/" target="_blank">http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/</a><br>
>>>> _______________________________________________<br>
>>>> Nagios-users mailing list<br>
>>>> <a href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</a><br>
>>>> <a href="https://lists.sourceforge.net/lists/listinfo/nagios-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-users</a><br>
>>>> ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.<br>
>>>> ::: Messages without supporting info will risk being sent to /dev/null<br>
>>> ------------------------------------------------------------------------------<br>
>>> Live Security Virtual Conference<br>
>>> Exclusive live event will cover all the ways today's security and<br>
>>> threat landscape has changed and how IT managers can respond. Discussions<br>
>>> will include endpoint security, mobile security and the latest in malware<br>
>>> threats. <a href="http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/" target="_blank">http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/</a><br>
>>> _______________________________________________<br>
>>> Nagios-users mailing list<br>
>>> <a href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</a><br>
>>> <a href="https://lists.sourceforge.net/lists/listinfo/nagios-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-users</a><br>
>>> ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.<br>
>>> ::: Messages without supporting info will risk being sent to /dev/null<br>
>> ------------------------------------------------------------------------------<br>
>> Live Security Virtual Conference<br>
>> Exclusive live event will cover all the ways today's security and<br>
>> threat landscape has changed and how IT managers can respond. Discussions<br>
>> will include endpoint security, mobile security and the latest in malware<br>
>> threats. <a href="http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/" target="_blank">http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/</a><br>
>> _______________________________________________<br>
>> Nagios-users mailing list<br>
>> <a href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</a><br>
>> <a href="https://lists.sourceforge.net/lists/listinfo/nagios-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-users</a><br>
>> ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.<br>
>> ::: Messages without supporting info will risk being sent to /dev/null<br>
><br>
><br>
> --<br>
><br>
><br>
> Mike Guthrie<br>
> Technical Team<br>
> ___<br>
> Nagios Enterprises, LLC<br>
> Email:  <a href="mailto:mguthrie@nagios.com">mguthrie@nagios.com</a><br>
> Web:    <a href="http://www.nagios.com" target="_blank">www.nagios.com</a><br>
><br>
><br>
> ------------------------------------------------------------------------------<br>
> Live Security Virtual Conference<br>
> Exclusive live event will cover all the ways today's security and<br>
> threat landscape has changed and how IT managers can respond. Discussions<br>
> will include endpoint security, mobile security and the latest in malware<br>
> threats. <a href="http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/" target="_blank">http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/</a><br>
> _______________________________________________<br>
> Nagios-users mailing list<br>
> <a href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</a><br>
> <a href="https://lists.sourceforge.net/lists/listinfo/nagios-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-users</a><br>
> ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.<br>
> ::: Messages without supporting info will risk being sent to /dev/null<br>
<br>
------------------------------------------------------------------------------<br>
Live Security Virtual Conference<br>
Exclusive live event will cover all the ways today's security and<br>
threat landscape has changed and how IT managers can respond. Discussions<br>
will include endpoint security, mobile security and the latest in malware<br>
threats. <a href="http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/" target="_blank">http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/</a><br>
_______________________________________________<br>
Nagios-users mailing list<br>
<a href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/nagios-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-users</a><br>
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.<br>
::: Messages without supporting info will risk being sent to /dev/null<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Liu Lantao<br>EMAIL: liulantao ( at ) gmail ( dot ) com ; <br>WEBSITE: <a href="http://www.liulantao.com/portal" target="_blank">http://www.liulantao.com/portal</a> .<br>