diff --git a/html/includes/print-interface.inc b/html/includes/print-interface.inc index 2c26dd8be..673866886 100644 --- a/html/includes/print-interface.inc +++ b/html/includes/print-interface.inc @@ -75,7 +75,7 @@ } echo(""); - echo(""); + echo(""); if ( strpos($ifDescr, "oopback") === false && !$dographs) { $link_query = mysql_query("select * from links AS L, interfaces AS I, devices AS D WHERE L.src_if = '$if_id' AND L.dst_if = I.interface_id AND I.device_id = D.device_id"); while($link = mysql_fetch_array($link_query)) { diff --git a/html/includes/print-syslog.inc b/html/includes/print-syslog.inc index 7d0ad0c21..538afdb67 100644 --- a/html/includes/print-syslog.inc +++ b/html/includes/print-syslog.inc @@ -17,10 +17,10 @@ if($bg == $list_colour_a) { $bg = $list_colour_b; } else { $bg=$list_colour_a; } echo(" "); - echo("" . $entry['date'] . ""); + echo("" . $entry['date'] . ""); if($_GET['page'] == "syslog") { - echo("".generatedevicelink($entry['device_id'], $entry['hostname']).""); + echo("".generatedevicelink($entry['device_id'], $entry['hostname']).""); } diff --git a/includes/polling/interfaces.inc.php b/includes/polling/interfaces.inc.php index 63155e40d..3422ca93b 100644 --- a/includes/polling/interfaces.inc.php +++ b/includes/polling/interfaces.inc.php @@ -3,7 +3,7 @@ $interface_query = mysql_query("SELECT * FROM `interfaces` $where"); while ($interface = mysql_fetch_array($interface_query)) { - if(!$device) { $device = mysql_fetch_array(mysql_query("SELECT * FROM `devices` WHERE device_id = '" . $interface['device_id'] . "'")); } + if(!$device) { $device = mysql_fetch_array(mysql_query("SELECT * FROM `devices` WHERE `device_id` = '" . $interface['device_id'] . "'")); } unset($ifAdminStatus, $ifOperStatus, $ifAlias, $ifDescr); @@ -110,6 +110,7 @@ while ($interface = mysql_fetch_array($interface_query)) { } $woo = "N:$ifHCInOctets:$ifHCOutOctets:$ifInErrors:$ifOutErrors:$ifInUcastPkts:$ifOutUcastPkts:$ifInNUcastPkts:$ifOutNUcastPkts"; $ret = rrdtool_update("$rrdfile", $woo); + } else { echo("Interface " . $device['hostname'] . " " . $interface['ifDescr'] . " is down\n"); } diff --git a/poll-device.php b/poll-device.php index a2df20fe6..daf2f2d3a 100755 --- a/poll-device.php +++ b/poll-device.php @@ -4,7 +4,7 @@ include("config.php"); include("includes/functions.php"); -echo("Observer Poller v$observer_version\n\n"); +echo("Observer Poller v".$config['version']."\n\n"); if($argv[1] == "--device" && $argv[2]) { $where = "AND `device_id` = '".$argv[2]."'"; @@ -23,8 +23,6 @@ if($argv[1] == "--device" && $argv[2]) { echo("Starting polling run:\n\n"); - - $device_query = mysql_query("SELECT * FROM `devices` WHERE `ignore` = '0' $where ORDER BY `device_id` ASC"); while ($device = mysql_fetch_array($device_query)) { @@ -252,10 +250,8 @@ while ($device = mysql_fetch_array($device_query)) { mysql_query("INSERT INTO eventlog (host, interface, datetime, message) VALUES ('" . $device['device_id'] . "', NULL, NOW(), 'Device status changed to $stat')"); } - if ($uptime) { - $old_uptime = mysql_result(mysql_query("SELECT `attrib_value` FROM `devices_attribs` WHERE `device_id` = '" . $device['device_id'] . "' AND `attrib_type` = 'uptime'"), 0); if( $uptime < $old_uptime ) {