Page 1 of 1
Export Host & Services to CSV
Posted: Fri Jun 15, 2018 6:51 am
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,
Re: Export Host & Services to CSV
Posted: Fri Jun 15, 2018 9:51 am
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.
Re: Export Host & Services to CSV
Posted: Fri Jun 15, 2018 10:43 am
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,
Re: Export Host & Services to CSV
Posted: Fri Jun 15, 2018 10:58 am
by mpedros
Dear mcapra:
Excellent tool, I did not know it. I think it will help me. Thank you so much for everything!
Regards,
Re: Export Host & Services to CSV
Posted: Fri Jun 15, 2018 1:15 pm
by kyang
Thanks
@mcapra!
mpedros, did you have any more questions or are we okay to close this thread?
Re: Export Host & Services to CSV
Posted: Fri Jun 15, 2018 3:05 pm
by mpedros
The solution populated by @mcapra is OK for me. Can close this thread.