add etherlike toggle option

git-svn-id: http://www.observium.org/svn/observer/trunk@511 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2009-11-11 11:43:06 +00:00
parent c51721af5c
commit 881d4abfb3
3 changed files with 9 additions and 17 deletions

View File

@@ -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';

View File

@@ -56,7 +56,7 @@ if($_GET['debug']) {
}
if($rrd_options) {
#echo("<pre>".$config['rrdtool'] . " graph $graphfile $rrd_options");
# echo("<pre>".$config['rrdtool'] . " graph $graphfile $rrd_options");
$thing = shell_exec($config['rrdtool'] . " graph $graphfile $rrd_options");
if(is_file($graphfile)) {
header('Content-type: image/png');

View File

@@ -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 \