Historic CPU data

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
aap
Posts: 180
Joined: Wed Oct 12, 2011 4:01 am

Historic CPU data

Post 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.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Historic CPU data

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Historic CPU data

Post 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
Nagios XI 5.8.1
https://outsideit.net
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Historic CPU data

Post by hsmith »

Thanks @WillemDH.

@aap do these suggestions help you out?
Former Nagios Employee.
me.
aap
Posts: 180
Joined: Wed Oct 12, 2011 4:01 am

Re: Historic CPU data

Post 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.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Historic CPU data

Post 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'
Former Nagios Employee
Locked