diff --git a/config.php.default b/config.php.default index af2ce50e6..ede43b92a 100755 --- a/config.php.default +++ b/config.php.default @@ -87,6 +87,7 @@ $config['enable_syslog'] = 0; # Enable Syslog $config['enable_billing'] = 0; # Enable Billing $config['enable_inventory'] = 1; # Enable Inventory $config['enable_pseudowires'] = 1; # Enable Pseudowires +$config['enable_etherlike'] = 1; # Enable Polling EtherLike-MIB (doubles interface processing time) #$config['rancid_configs'] = '/var/lib/rancid/network/configs/'; #$config['collectd_dir'] = '/var/lib/collectd/rrd'; diff --git a/html/graph.php b/html/graph.php index 5298e8403..d7f6078ab 100644 --- a/html/graph.php +++ b/html/graph.php @@ -56,7 +56,7 @@ if($_GET['debug']) { } if($rrd_options) { - #echo("
".$config['rrdtool'] . " graph $graphfile $rrd_options");
+# echo("".$config['rrdtool'] . " graph $graphfile $rrd_options");
$thing = shell_exec($config['rrdtool'] . " graph $graphfile $rrd_options");
if(is_file($graphfile)) {
header('Content-type: image/png');
diff --git a/poll-device.php b/poll-device.php
index 93563ee2c..46a5c24a6 100755
--- a/poll-device.php
+++ b/poll-device.php
@@ -155,20 +155,14 @@ while ($device = mysql_fetch_array($device_query)) {
}
$sysLocation = str_replace("\"","", $sysLocation);
- echo("Polling temperatures\n");
- include("includes/polling/temperatures.inc.php");
- include("includes/polling/device-netstats.inc.php");
+ include("includes/polling/temperatures.inc.php");
+ include("includes/polling/device-netstats.inc.php");
+ include("includes/polling/ports.inc.php");
+ if($config['enable_etherlike']) { include("includes/polling/ports-etherlike.inc.php"); }
+ include("includes/polling/cisco-mac-accounting.inc.php");
-# echo("Polling interfaces\n");
-# $where = "WHERE device_id = '" . $device['device_id'] . "' AND deleted = '0'";
-# include("includes/polling/interfaces.inc.php");
-
- include("includes/polling/ports.inc.php");
- include("includes/polling/ports-etherlike.inc.php");
- include("includes/polling/cisco-mac-accounting.inc.php");
-
- $update_uptime_attrib = mysql_query("UPDATE devices_attribs SET attrib_value = NOW() WHERE `device_id` = '" . $device['device_id'] . "' AND `attrib_type` = 'polled'");
- if(mysql_affected_rows() == '0') {
+ $update_uptime_attrib = mysql_query("UPDATE devices_attribs SET attrib_value = NOW() WHERE `device_id` = '" . $device['device_id'] . "' AND `attrib_type` = 'polled'");
+ if(mysql_affected_rows() == '0') {
$insert_uptime_attrib = mysql_query("INSERT INTO devices_attribs (`device_id`, `attrib_type`, `attrib_value`) VALUES ('" . $device['device_id'] . "', 'polled', NOW())");
}
@@ -248,9 +242,6 @@ while ($device = mysql_fetch_array($device_query)) {
$uptimerrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/uptime.rrd";
- $old_uptimerrd = "rrd/" . $device['hostname'] . "-uptime.rrd";
- if(is_file($old_uptimerrd) && !is_file($uptimerrd)) { rename($old_uptimerrd, $uptimerrd); echo("Moving $old_uptimerrd to $uptimerrd"); }
-
if(!is_file($uptimerrd)) {
$woo = shell_exec($config['rrdtool'] . " create $uptimerrd \
DS:uptime:GAUGE:600:0:U \