Page 1 of 1
Historic CPU data
Posted: Fri Feb 12, 2016 6:11 am
by aap
Hi,
Is there a way I can get historic cpu data for all hosts monitored in Nagios? Min, Max, Average usage for over a year? Ideally exported as a csv.
Any help is appreciated.
Re: Historic CPU data
Posted: Fri Feb 12, 2016 12:17 pm
by lmiltchev
Do you want to see the CPU usage of ALL hosts aggregated in one CSV file?
With the new version of XI coming up, you would be able to download perf graph (for example, CPU Usage for the "Last 365 Days") as CSV. This is done on "per host/service" basis. I don't know if there is a way of aggregating all hosts in one file. This could be a new feature request.
Re: Historic CPU data
Posted: Fri Feb 12, 2016 2:18 pm
by WillemDH
Aap,
If you can't wait or have the scripting skills, you can in fact achieve this with rrdtool. For example:
SRV_CPU is in my XI the service which monitors CPU usage.
Code: Select all
Average value of SRV_CPU.rrd
rrdtool graph dummy -s -1month -e start+1month DEF:test=_HOST_.rrd:1:AVERAGE PRINT:test:AVERAGE:'average - %.0lf'
Grtz
Willem
Re: Historic CPU data
Posted: Fri Feb 12, 2016 3:06 pm
by hsmith
Thanks
@WillemDH.
@aap do these suggestions help you out?
Re: Historic CPU data
Posted: Sat Feb 13, 2016 6:17 am
by aap
Hi,
Thanks for both your inputs.
Scripting skills are pretty basic so not sure where to start really.
I do think being able to get this data out from XI would be a great feature. Can we put it in the list?
@WillemDH I have a standard install of XI with little modifications, how can I use the rrdtool to get this data out. Permit my ignorance.
Thanks again.
Re: Historic CPU data
Posted: Mon Feb 15, 2016 1:48 pm
by rkennedy
Look into
/usr/local/nagios/share/perfdata/, and from there cd into the host you're looking to check.
From there, you can run the command Willem mentioned -
Code: Select all
rrdtool graph dummy -s -1month -e start+1month DEF:test=_HOST_.rrd:1:AVERAGE PRINT:test:AVERAGE:'average - %.0lf'