Poller run time graphing

This commit is contained in:
laf
2014-09-21 20:47:32 +01:00
parent 97a21ae519
commit 6c28f6367e
4 changed files with 37 additions and 4 deletions
@@ -0,0 +1,27 @@
<?php
/*
* LibreNMS
*
* Copyright (c) 2014 Neil Lathwood <https://github.com/laf/ http://www.lathwood.co.uk/fa>
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version. Please see LICENSE.txt at the top level of
* the source code distribution for details.
*/
$scale_min = "0";
include("includes/graphs/common.inc.php");
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/poller-perf.rrd";
$rrd_options .= " DEF:poller=".$rrd_filename.":poller:AVERAGE";
$rrd_options .= " 'COMMENT:Seconds Current Minimum Maximum Average\\n'";
$rrd_options .= " AREA:poller#EEEEEE:Poller";
$rrd_options .= " GPRINT:poller:LAST:%6.2lf GPRINT:poller:AVERAGE:%6.2lf";
$rrd_options .= " GPRINT:poller:MAX:%6.2lf 'GPRINT:poller:AVERAGE:%6.2lf\\n'";
?>
+3
View File
@@ -23,6 +23,9 @@ foreach (dbFetchRows("SELECT * FROM device_graphs WHERE device_id = ? ORDER BY g
$graph_enable[$section][$graph['graph']] = $graph['graph'];
}
// These are standard graphs we should have for all systems
$graph_enable['poller']['poller_perf'] = 'device_poller_perf';
#foreach ($config['graph_sections'] as $section)
foreach ($graph_enable as $section => $nothing)
{
+3
View File
@@ -1058,6 +1058,9 @@ $config['graph_types']['device']['ucd_interrupts']['descr'] = 'Interrupts';
$config['graph_types']['device']['uptime']['section'] = 'system';
$config['graph_types']['device']['uptime']['order'] = '0';
$config['graph_types']['device']['uptime']['descr'] = 'System Uptime';
$config['graph_types']['device']['poller_perf']['section'] = 'poller';
$config['graph_types']['device']['poller_perf']['order'] = '0';
$config['graph_types']['device']['poller_perf']['descr'] = 'Poller Performance';
$config['graph_types']['device']['vpdn_sessions_l2tp']['section'] = 'vpdn';
$config['graph_types']['device']['vpdn_sessions_l2tp']['order'] = '0';
+4 -4
View File
@@ -196,14 +196,14 @@ function poll_device($device, $options)
$device_end = utime(); $device_run = $device_end - $device_start; $device_time = substr($device_run, 0, 5);
$performance_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/performance-poller.rrd";
if (!is_file($performance_rrd))
$poller_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/poller-perf.rrd";
if (!is_file($poller_rrd))
{
rrdtool_create ($performance_rrd, "DS:performance:GAUGE:600:0:U ".$config['rrd_rra']);
rrdtool_create ($poller_rrd, "DS:poller:GAUGE:600:0:U ".$config['rrd_rra']);
}
if(!empty($device_time))
{
rrdtool_update($performance_rrd, "N:".$device_time);
rrdtool_update($poller_rrd, "N:".$device_time);
}
$update_array['last_polled'] = array('NOW()');