Reporting

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
MSPk
Posts: 317
Joined: Fri Aug 24, 2012 12:03 am

Re: Reporting

Post 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
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Reporting

Post 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>
MSPk
Posts: 317
Joined: Fri Aug 24, 2012 12:03 am

Re: Reporting

Post 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.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Reporting

Post 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
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Reporting

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
MSPk
Posts: 317
Joined: Fri Aug 24, 2012 12:03 am

Re: Reporting

Post by MSPk »

how can we extract the data for all the hosts being monitored by nagios in one go?
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Reporting

Post 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.
MSPk
Posts: 317
Joined: Fri Aug 24, 2012 12:03 am

Re: Reporting

Post 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?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Reporting

Post 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
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
MSPk
Posts: 317
Joined: Fri Aug 24, 2012 12:03 am

Re: Reporting

Post 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.
Locked