= $snmpEngineTime) { notify($device, 'Device rebooted: '.$device['hostname'], 'Device Rebooted : '.$device['hostname'].' '.formatUptime($uptime).' ago.'); log_event('Device rebooted after '.formatUptime($device['uptime']), $device, 'reboot', $device['uptime']); } $uptime_rrd = $config['rrd_dir'].'/'.$device['hostname'].'/uptime.rrd'; if (!is_file($uptime_rrd)) { rrdtool_create($uptime_rrd, 'DS:uptime:GAUGE:600:0:U '.$config['rrd_rra']); } rrdtool_update($uptime_rrd, 'N:'.$uptime); $graphs['uptime'] = true; echo 'Uptime: '.formatUptime($uptime)."\n"; $update_array['uptime'] = $uptime; }//end if $poll_device['sysLocation'] = str_replace('"', '', $poll_device['sysLocation']); // Remove leading & trailing backslashes added by VyOS/Vyatta/EdgeOS $poll_device['sysLocation'] = trim($poll_device['sysLocation'], '\\'); // Rewrite sysLocation if there is a mapping array (database too?) if (!empty($poll_device['sysLocation']) && is_array($config['location_map'])) { $poll_device['sysLocation'] = rewrite_location($poll_device['sysLocation']); } $poll_device['sysContact'] = str_replace('"', '', $poll_device['sysContact']); // Remove leading & trailing backslashes added by VyOS/Vyatta/EdgeOS $poll_device['sysContact'] = trim($poll_device['sysContact'], '\\'); foreach (array('sysLocation', 'sysContact') as $elem) { if ($poll_device[$elem] == 'not set') { $poll_device[$elem] = ''; } } // Save results of various polled values to the database foreach (array('sysContact', 'sysObjectID', 'sysName', 'sysDescr') as $elem) { if ($poll_device[$elem] && $poll_device[$elem] != $device[$elem]) { $update_array[$elem] = $poll_device[$elem]; log_event("$elem -> ".$poll_device[$elem], $device, 'system'); } } if ($poll_device['sysLocation'] && $device['location'] != $poll_device['sysLocation']) { if (!get_dev_attrib($device, 'override_sysLocation_bool')) { $update_array['location'] = $poll_device['sysLocation']; log_event('Location -> '.$poll_device['sysLocation'], $device, 'system'); } }