Rebased against master; use data_update for uptime

This commit is contained in:
Paul Gear
2016-01-15 21:52:09 +10:00
parent 33091034d2
commit 72b9f52c59

View File

@ -65,22 +65,10 @@ if (is_numeric($uptime)) {
log_event('Device rebooted after '.formatUptime($device['uptime']), $device, 'reboot', $device['uptime']); log_event('Device rebooted after '.formatUptime($device['uptime']), $device, 'reboot', $device['uptime']);
} }
$uptime_rrd = $config['rrd_dir'].'/'.$device['hostname'].'/uptime.rrd'; $tags = array(
'rrd_def' => 'DS:uptime:GAUGE:600:0:U',
if (!is_file($uptime_rrd)) {
rrdtool_create($uptime_rrd, 'DS:uptime:GAUGE:600:0:U '.$config['rrd_rra']);
}
$fields = array(
'uptime' => $uptime,
); );
data_update($device, 'uptime', $tags, $uptime);
rrdtool_update($uptime_rrd, $fields);
$measurement = 'uptime';
$tags = array();
influx_update($device,$measurement,$tags,$fields);
$graphs['uptime'] = true; $graphs['uptime'] = true;