From 97a21ae519c76c5dab100c7f79fa6eefc1d5cbfe Mon Sep 17 00:00:00 2001 From: laf Date: Wed, 20 Aug 2014 16:22:21 +0100 Subject: [PATCH] Start on graphing performance metrics --- includes/polling/functions.inc.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/includes/polling/functions.inc.php b/includes/polling/functions.inc.php index 567c6031e..2214372c6 100644 --- a/includes/polling/functions.inc.php +++ b/includes/polling/functions.inc.php @@ -196,6 +196,16 @@ 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)) + { + rrdtool_create ($performance_rrd, "DS:performance:GAUGE:600:0:U ".$config['rrd_rra']); + } + if(!empty($device_time)) + { + rrdtool_update($performance_rrd, "N:".$device_time); + } + $update_array['last_polled'] = array('NOW()'); $update_array['last_polled_timetaken'] = $device_time;