Store performance data for each poller module

This commit is contained in:
Mike Rostermund
2016-01-24 03:43:59 +01:00
parent 2a2d5bcd6e
commit 006056a754
4 changed files with 51 additions and 1 deletions

View File

@@ -230,6 +230,14 @@ function poll_device($device, $options) {
include 'includes/polling/'.$module.'.inc.php';
$module_time = microtime(true) - $module_start;
echo "Runtime for polling module '$module': $module_time\n";
$tags = array(
'rrd_def' => 'DS:'.$module.':GAUGE:600:0:U',
);
$fields = array(
$module => $module_time,
);
data_update($device, 'poller-'.$module.'-perf', $tags, $fields);
}
else if (isset($attribs['poll_'.$module]) && $attribs['poll_'.$module] == '0') {
echo "Module [ $module ] disabled on host.\n";