Export Host & Services to CSV

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
User avatar
mpedros
Posts: 27
Joined: Wed Jan 10, 2018 6:30 pm
Location: Buenos Aires, Argentina

Export Host & Services to CSV

Post by mpedros »

Dear Team:

Does anyone know how do I export to a CSV file the complete list of host and services of each host that are being monitored in a Nagios Core?

Regards,
Last edited by mpedros on Fri Jun 15, 2018 10:59 am, edited 1 time in total.
Martin Pedros
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Export Host & Services to CSV

Post by mcapra »

You can use the JSON CGIs to get a list:
https://labs.nagios.com/2014/06/19/expl ... -7-part-1/

If you're using a recent Nagios Core version, the CGIs should already be available; No installation needed.

Converting the resulting JSON to CSV is pretty easy from there. There's plenty of online converters that will do it for you.

Or if you're on Nagios Core 3, you could parse status.dat with some clever sed/awk/grep to convert parts of that into CSV.
Former Nagios employee
https://www.mcapra.com/
User avatar
mpedros
Posts: 27
Joined: Wed Jan 10, 2018 6:30 pm
Location: Buenos Aires, Argentina

Re: Export Host & Services to CSV

Post by mpedros »

Dear mcapra:

Thank you very much for your help, I'm going to investigate how to do with the link that you sent me. I will update with the news.

Regards,
Martin Pedros
User avatar
mpedros
Posts: 27
Joined: Wed Jan 10, 2018 6:30 pm
Location: Buenos Aires, Argentina

Re: Export Host & Services to CSV

Post by mpedros »

Dear mcapra:

Excellent tool, I did not know it. I think it will help me. Thank you so much for everything!

Regards,
Attachments
JSON.png
Martin Pedros
kyang

Re: Export Host & Services to CSV

Post by kyang »

Thanks @mcapra!

mpedros, did you have any more questions or are we okay to close this thread?
User avatar
mpedros
Posts: 27
Joined: Wed Jan 10, 2018 6:30 pm
Location: Buenos Aires, Argentina

Re: Export Host & Services to CSV

Post by mpedros »

The solution populated by @mcapra is OK for me. Can close this thread.
Martin Pedros
Locked