Page 1 of 1

Export service details

Posted: Sat Dec 09, 2017 12:52 am
by Ayush Jain
Hi Team,

Is it possible to export service details which we are monitoring, in csv or xls format from NagiosXI.

for ex:

Host Service
A CPU_LOAD
A Memory
B Tomcat Process

Thanks,
Ayush Jain

Re: Export service details

Posted: Mon Dec 11, 2017 11:19 am
by kyang
Are you looking for something like this?
Capture.PNG
This can be done in the state history report. XI home --> Reports --> State history report under available reports section.

What service details are you looking for? Previous or current?

Does this help?

Re: Export service details

Posted: Tue Dec 12, 2017 1:30 am
by Ayush Jain
I am just looking for all host/service which we are monitoring in Nagios.
csv list should be having 2 columns ( 1st hostname, 2nd service name)

Re: Export service details

Posted: Tue Dec 12, 2017 12:41 pm
by kyang
We don't have any report to show all host/services that are being monitored.

You could try to grep the status.dat or objects.cache file and send it to a csv?

Here's a small solution, it's not displayed in two columns, but it's just to give you an idea.

Code: Select all

grep -A 1 'host_name=\|service_description=' /usr/local/nagios/var/status.dat
The output.

Code: Select all

        host_name=localhost
        service_description=Swap Usage
        modified_attributes=0
--
        host_name=localhost
        service_description=Total Processes
        modified_attributes=0
Save it to a csv file and transfer it to your desktop.

Code: Select all

grep -A 1 'host_name=\|service_description=' /usr/local/nagios/var/status.dat > /tmp/test.csv
I'm sure there's a better way, that you could try.

Re: Export service details

Posted: Wed Dec 13, 2017 7:14 am
by Ayush Jain
I guess from this data i can write script to get the desired output :-)

Thanks,
Ayush Jain

Re: Export service details

Posted: Wed Dec 13, 2017 10:04 am
by kyang
No problem!

Did you have any more questions? Or are we okay to lock up this thread?

Re: Export service details

Posted: Fri Dec 15, 2017 1:54 am
by Ayush Jain
yeah please lock it up .
Thanks:-)

Re: Export service details

Posted: Fri Dec 15, 2017 10:03 am
by kyang
Sounds good! I'll be closing this thread!

If you have any more questions, feel free to create another thread.

Thanks for using the Nagios Support Forum!