Nagios Graphs and Historical Reporting

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
YDardeer
Posts: 12
Joined: Mon Dec 24, 2012 4:38 am

Nagios Graphs and Historical Reporting

Post by YDardeer »

I'm using Nagios Core to monitor temperature of a walk-in freezer using Websesor EM08, which comes with its own Nagios plugin. Now Nagios Core covers my realtime monitoring and alerting just fine. However, I have the following requirements and I'm wondering what is the most suitable extension to use that will cover my requirements
1) Graphing. I need to be able to view a graph of the monitored temperature throughout the day
2) Reporting. I need to be able to generate weekly/monthly reports that can be sent to users

Any suggestions?

Yousef Dardeer
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Nagios Graphs and Historical Reporting

Post by jdalrymple »

The easiest solution is to use NagiosXI, these features are built in.

Barring using XI, my preferred graphing solution is pnp4nagios.

Regarding reporting - some is built into core. What specifically are you trying to report on? Can you give us an example of data you might expect this report to contain?
YDardeer
Posts: 12
Joined: Mon Dec 24, 2012 4:38 am

Re: Nagios Graphs and Historical Reporting

Post by YDardeer »

many thanks for the quick reply. a reporting example would be: send a report containing the temperature of the freezer for last week, or last month. preferably a graph of the monitored temperature would be perfect, but I can live with a report of only temperatures and the time it was collected. something like:
_________________
|day | time | temp|
|sat | 12:00| 4.1 |
|sun | 12:05|5.0 |
etc

the only reason i'm using Nagios Core instead of Nagios XI is because I assumed that XI is the paid version, and I'm not looking to invest money on the monitoring solution yet

Thanks
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Nagios Graphs and Historical Reporting

Post by jdalrymple »

pnp4nagios can generate CSV data for you:

http://docs.pnp4nagios.org/pnp-0.6/xport

You could have a cron job curl this data and E-mail it to you or do whatever else you like with it on whatever schedule you deem necessary. pnp4nagios can also generate PDFs that you can likewise E-mail to yourself or whatever.
YDardeer
Posts: 12
Joined: Mon Dec 24, 2012 4:38 am

Re: Nagios Graphs and Historical Reporting

Post by YDardeer »

Many thanks. I'll give it a go

Any install/setup guides you recommend?
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Nagios Graphs and Historical Reporting

Post by jdalrymple »

The pnp4nagios wiki is a fine documentation source.
YDardeer
Posts: 12
Joined: Mon Dec 24, 2012 4:38 am

Re: Nagios Graphs and Historical Reporting

Post by YDardeer »

Just an update so this could be useful for anyone else

PNP4Nagios worked quite nice for what I'm looking for. I now have temperature alerts and performance graphs for the Websensor EM08. Sync mode with pnp4nagios 0.6.25 is apparently not supported with nagios core 4.1.1 (yet). but bulk mode worked perfectly

I haven't tried the export to csv feature yet. I'm waiting for more data to be generated before I test it.


Many thanks for the support
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Nagios Graphs and Historical Reporting

Post by jdalrymple »

YDardeer wrote:I haven't tried the export to csv feature yet. I'm waiting for more data to be generated before I test it.
It *just works*

I've never seen it not. Let us know if it fails, otherwise I'll look forward to locking this topic and marking solved?
YDardeer
Posts: 12
Joined: Mon Dec 24, 2012 4:38 am

Re: Nagios Graphs and Historical Reporting

Post by YDardeer »

using the following URL at a browser gets the correct output

Code: Select all

http://x.x.x.x/pnp4nagios/xport/csv?host=large_freezer&srv=Temperature&start=-1hour
however using curl at the command line to download the content gets me an error

Code: Select all

root@nagios:/usr/local/nagios/etc# curl http://nagiosadmin:[email protected]/pnp4nagios/xport/csv?host=large_freezer&srv=Temperature&start=-1hour
[1] 26227
[2] 26228
root@nagios:/usr/local/nagios/etc# <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<meta http-equiv="refresh" content="60">
<title>Framework Error</title>
<link rel="stylesheet" type="text/css" href="/pnp4nagios/media/css/common.css" />
<link rel="stylesheet" type="text/css" href="/pnp4nagios/media/css/ui-smoothness/jquery-ui.css" />
<link rel="icon" type="image/ico" href="/pnp4nagios/media/images/favicon.ico" />
<script type="text/javascript" src="/pnp4nagios/media/js/jquery-min.js"></script>
<script type="text/javascript" src="/pnp4nagios/media/js/jquery-ui.min.js"></script>
<style type="text/css">
</style>
</head>
<body>
<div class="pagebody">
<table class="body">
<tr valign="top"><td>
<div class="left ui-widget">
<div class="p2 ui-widget-header ui-corner-top">
PNP4Nagios Version 0.6.25</div>
<div class="p4 ui-widget-content ui-corner-bottom" style="width: 640px">
<div style="padding: 0pt 0.7em;" class="ui-state-error ui-corner-all">

<h3>Please check the documentation for information about the following error.</h3>
<p>Xport controller needs "host" and "srv" URL parameters. <a href="http://docs.pnp4nagios.org/faq/18">Read FAQ online</a></p>
<h3>file [line]:</h3>
<p><tt>application/controllers/xport.php <strong>[69]:</strong></tt></p>
<p>
<a href="javascript:history.back()">back</a>

</div>
</div>
</td><td>
<div class="right">

<div class="ui-widget">

<div class="p2 ui-widget-header ui-corner-top">
Actions</div>

<div class="p4 ui-widget-content ui-corner-bottom" >
<a title="back" href="javascript:history.back()"><img class="icon" src="/pnp4nagios/media/images/back.png"></a>
<a title="View Graphs" href="/pnp4nagios/graph"><img class="icon" src="/pnp4nagios/media/images/home.png"></a>
<a title="View Documentation" href="/pnp4nagios/docs"><img class="icon" src="/pnp4nagios/media/images/docs.png"></a>
</div>

</div>

</div>
</td></tr>
<tr valign="top"><td colspan="2">
<div class="left">
<div class="cb p4 ui-widget-content ui-corner-all">
pnp4nagios-0.6.25 [ 03-01-2015 ]</div>
</div>
</div>
</td></tr></table>
</div>

</body>
</html>

[1]-  Done                    curl http://nagiosadmin:[email protected]/pnp4nagios/xport/csv?host=large_freezer
[2]+  Done                    srv=Temperature
root@nagios:/usr/local/nagios/etc#
is something wrong with the curl command?
YDardeer
Posts: 12
Joined: Mon Dec 24, 2012 4:38 am

Re: Nagios Graphs and Historical Reporting

Post by YDardeer »

Silly me. I just needed to escape the '?' character.

as you said, it just works!

you can mark this as solved if you want. many thanks for the support
Locked