He would like to be able to export a CSV file of all the hosts he has access to.
Looking around I found a few possible solutions, but they aren't very customizable. For example allowing me or him to specify which columns should be exported.
Examples of what I found: (source)
Code: Select all
http://<ip>/nagios/cgi-bin/objectjson.cgi?query=hostlistCode: Select all
http://<ip>/nagiosxi/backend/?cmd=gethosts&brevity=3Also found linux code, so I could maybe make a bash script to do this, but there are a few issues with this.
Code: Select all
echo "use nagiosql; select display_name,notes,address from tbl_host into outfile '/tmp/hosts.csv' fields terminated by ',' enclosed by '\"' lines terminated by '\n'" | mysql -u root -pnagiosxiNot to mention the fact that I need display it on the Nagios XI site, which I have no idea how to do. Maybe it is possible to create a tool or something that can do this?
The output I am hoping to produce is simply something like this:
Code: Select all
<display_name>,<notes>,<address>
<display_name>,<notes>,<address>
<display_name>,<notes>,<address>