Page 2 of 6

Re: Reporting

Posted: Tue Jun 25, 2013 1:26 am
by MSPk
Is it a bug with the version 1.8??
The values stored in RRDs are averages over certain periods of time. Do not expect them to be the exact value at the time recorded. This is done to save space as performance data can fill hard drives quickly. You can use rrdfetch to pull specific values from the rrds for certain times and dump them to stdout, just remember that these values are averaged.
what is the location of these rrd files? rrdfetch asks me the name of the file which we want to fetch and change to xml format, Please help in getting these stats as we need to demeostrate this to the client to get their approval procure licenses

Re: Reporting

Posted: Tue Jun 25, 2013 9:02 am
by slansing
Yes, you will want to upgrade to 2012 r2.2 to give the best demo to your client..

The RRD's are located at:

Code: Select all

/usr/local/nagios/share/perfdata/<hostname>

Re: Reporting

Posted: Tue Jun 25, 2013 11:26 am
by MSPk
do we have any documentation on how we can extract the data from these rrd's with some examples? as the location already has xml files.

My requirement is to get the perfdata for a specific host/service for a specified time (might be 5mins, 15mins, 24hr, etc.., ) in a csv/excel format.

Re: Reporting

Posted: Tue Jun 25, 2013 12:05 pm
by abrist
You can use rrddump to export rrds to xml. There are a myriad of different options to get rrds to csv, see the following google search:
https://www.google.com/search?q=rrd+to+csv

Re: Reporting

Posted: Tue Jun 25, 2013 5:55 pm
by Box293
Hi MSPk,
While this will not help you right now, I am currently developing a component for Nagios XI that will analyse the data in the rrd files and display them in a table format. I had not thought about being able to export this data to csv/excel format however this is a great idea so I'll look at incorporating the idea into the componment. This will be called the "Performance Data Tool" and analysing rrd files is just one part of the functionality it will provide.

I am aiming to release it at the Nagios World Conference 2013 as part of the presentation I will be giving titled "Performance Data and Graphs".

Enough talking about me. Here is an example of how to pull data from the rrd files.

On the CLI of the Nagios XI host:

Code: Select all

rrdtool fetch /usr/local/nagios/share/perfdata/localhost/_HOST_.rrd MAX -r 900 -s -1h

gives the output:

                              1                   2

1372197300: 1.6577777778e-02 0.0000000000e+00
1372197600: 1.6960000000e-02 0.0000000000e+00
1372197900: 1.6960000000e-02 0.0000000000e+00
1372198200: 2.0400000000e-02 0.0000000000e+00
1372198500: 2.2020000000e-02 0.0000000000e+00
1372198800: 2.6422222222e-02 0.0000000000e+00
1372199100: 2.6422222222e-02 0.0000000000e+00
1372199400: 1.9300000000e-02 0.0000000000e+00
1372199700: 1.8360000000e-02 0.0000000000e+00
1372200000: 1.8786666667e-02 0.0000000000e+00
1372200300: 1.8786666667e-02 0.0000000000e+00
1372200600: nan nan
1372200900: nan nan
This is the rrd file for the localhost's (Nagios XI host) host object. There are two datasources in this RRD file, Round Trip Time and Packet Loss.

Information on the rrdtool.

This should be enough information to get you started.

Re: Reporting

Posted: Wed Jun 26, 2013 8:47 am
by MSPk
how can we extract the data for all the hosts being monitored by nagios in one go?

Re: Reporting

Posted: Wed Jun 26, 2013 9:34 am
by slansing
You could use the tool andy suggested above, I'd research the tool on their site for ways to accomplish what you are looking to do.

Re: Reporting

Posted: Fri Jun 28, 2013 5:56 am
by MSPk
I have couple of questions

Is the data in these rrd files also available on the mysql DB on nagios server?
How to write the output of a fetch into a xml file?
I have used dump command (rrdtool) on one of the parameters which is polled every 15mins, however I get the details in 1 min interval. How do I get the actual details collected when the check was executed?

Re: Reporting

Posted: Fri Jun 28, 2013 9:48 am
by abrist
MSPk wrote: Is the data in these rrd files also available on the mysql DB on nagios server?
No, the data in RRDs is performance data, this information is not stored in the "nagios" DB, as it is stored in the respective RRD
MSPk wrote:I have used dump command (rrdtool) on one of the parameters which is polled every 15mins, however I get the details in 1 min interval. How do I get the actual details collected when the check was executed?
You can get the check details from the event log, or archived nagios.log logs, but RRDs are an averaged, lossy aggregate database. They are used for trends, and become less granular with time.
MSPk wrote:How to write the output of a fetch into a xml file?

For example:

Code: Select all

rrdtool dump filename.rrd > filename.xml

Re: Reporting

Posted: Fri Jun 28, 2013 10:05 am
by MSPk
abrist wrote:You can get the check details from the event log, or archived nagios.log logs, but RRDs are an averaged, lossy aggregate database. They are used for trends, and become less granular with time.
Can we extract this data from the event log or nagios.log? if yes, please suggest how this can be achived?
abrist wrote:rrdtool dump filename.rrd > filename.xml
This is for dump, What I wanted is get the information from the fetch command - rrdtool fetch filename.rrd MAX -r 900 -s -1h - This command will show the output on the cli, how do we write this data into a xml, so that we use it for reporting.