mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fixed polling ports so that NULL values don't break stuff. Basically I just have a foreach loop to unset any NULL values. Also fixed the NOW() SQL statements at the end of polling.
This commit is contained in:
@@ -223,9 +223,9 @@ function poll_device($device, $options)
|
||||
rrdtool_update($ping_rrd, "N:$ping_time");
|
||||
}
|
||||
|
||||
$update_array['last_polled'] = array('NOW()');
|
||||
$update_array['last_polled'] = 'NOW()';
|
||||
$update_array['last_polled_timetaken'] = $device_time;
|
||||
$update_array['last_ping'] = array('NOW()');
|
||||
$update_array['last_ping'] = 'NOW()';
|
||||
$update_array['last_ping_timetaken'] = $ping_time;
|
||||
|
||||
#echo("$device_end - $device_start; $device_time $device_run");
|
||||
|
@@ -430,6 +430,12 @@ foreach ($ports as $port)
|
||||
$memcache->set('port-'.$port['port_id'].'-state', $port['state']);
|
||||
}
|
||||
|
||||
foreach ($port['update'] as $key => $val_check){
|
||||
if (!isset($val_check)) {
|
||||
unset($port['update'][$key]);
|
||||
}
|
||||
}
|
||||
|
||||
// Update Database
|
||||
if (count($port['update']))
|
||||
{
|
||||
|
Reference in New Issue
Block a user