From 60ea70fe57104432ba085cb9fcd4ecf250b7fa2f Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Sun, 18 Jul 2010 08:20:30 +0000 Subject: [PATCH] changes since changes began git-svn-id: http://www.observium.org/svn/observer/trunk@1403 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/includes/functions.inc.php | 8 ++++++-- html/pages/device/interface.inc.php | 10 ++++++++-- includes/defaults.inc.php | 3 ++- .../discovery/temperatures/cisco-entity-sensor.inc.php | 5 ++++- includes/polling/device-ios.inc.php | 8 ++++++++ includes/polling/ports.inc.php | 3 +++ 6 files changed, 31 insertions(+), 6 deletions(-) diff --git a/html/includes/functions.inc.php b/html/includes/functions.inc.php index ecdb1e391f..a2343c771f 100644 --- a/html/includes/functions.inc.php +++ b/html/includes/functions.inc.php @@ -3,10 +3,14 @@ function rewrite_entity_descr ($descr) { $descr = str_replace("Distributed Forwarding Card", "DFC", $descr); - $descr = preg_replace("/7600 Series SPA Interface Processor-/", "SIP-", $descr); + $descr = preg_replace("/7600 Series SPA Interface Processor-/", "7600 SIP-", $descr); $descr = preg_replace("/Rev\.\ [0-9\.]+\ /", "", $descr); - + $descr = preg_replace("/12000 Series Performance Route Processor/", "12000 PRP", $descr); + $descr = preg_replace("/^12000/", "", $descr); + $descr = preg_replace("/Gigabit Ethernet/", "GigE", $descr); + $descr = preg_replace("/^ASR1000\ /", "", $descr); $descr = str_replace("Routing Processor", "RP", $descr); + $descr = str_replace("Route Processor", "RP", $descr); $descr = str_replace("Switching Processor", "SP", $descr); $descr = str_replace("Sub-Module", "Module ", $descr); $descr = str_replace("DFC Card", "DFC", $descr); diff --git a/html/pages/device/interface.inc.php b/html/pages/device/interface.inc.php index ce6bd685b6..79b35f40e2 100644 --- a/html/pages/device/interface.inc.php +++ b/html/pages/device/interface.inc.php @@ -52,8 +52,14 @@ echo("
"); print_optionbar_start(); -echo ("Graphs | -ARP Table$pagp"); +echo ("Graphs | "); + +if(mysql_result(mysql_query("SELECT COUNT(*) FROM `ports_adsl` WHERE `interface_id` = '".$interface['interface_id']."'"),0)) +{ + echo("ADSL | "); +} + +echo ("ARP Table$pagp"); diff --git a/includes/defaults.inc.php b/includes/defaults.inc.php index 8edaee6647..759baf6ca4 100644 --- a/includes/defaults.inc.php +++ b/includes/defaults.inc.php @@ -127,6 +127,7 @@ $config['enable_pseudowires'] = 1; # Enable Pseudowires $config['enable_ports_junoseatmvp'] = 0; # Enable JunOSe ATM VC Discovery/Poller $config['enable_ports_etherlike'] = 0; # Enable Polling EtherLike-MIB (doubles interface processing time) $config['enable_printers'] = 0; # Enable Printer support +$config['enable_ports_adsl'] = 1; # Enable ADSL-LINE-MIB ### External Integration @@ -151,7 +152,7 @@ $config['ignore_mount_removable'] = 1; # Ignore removable disk storage $config['ignore_mount_network'] = 1; # Ignore network mounted storage $config['ignore_mount_optical'] = 1; # Ignore mounted optical discs -$config['device_traffic_iftype'] = array('/loopback/','/other/','/tunnel/','/virtual/','/mpls/'); +$config['device_traffic_iftype'] = array('/loopback/','/tunnel/','/virtual/','/mpls/'); $config['device_traffic_descr'] = array('/loopback/','/vlan/','/tunnel/','/:\d+/'); ### Authentication diff --git a/includes/discovery/temperatures/cisco-entity-sensor.inc.php b/includes/discovery/temperatures/cisco-entity-sensor.inc.php index f2bd8aa223..83fb3c0f3a 100644 --- a/includes/discovery/temperatures/cisco-entity-sensor.inc.php +++ b/includes/discovery/temperatures/cisco-entity-sensor.inc.php @@ -26,8 +26,11 @@ if ($device['os'] == "ios" || $device['os_group'] == "ios") $descr = snmp_get($device, "entPhysicalDescr.".$index, "-Oqv", "ENTITY-MIB"); $oid = ".1.3.6.1.4.1.9.9.91.1.1.1.1.4.".$index; $current = $entry['entSensorValue']; + + if($entry['entSensorScale'] == "milli") { $divisor = "1000"; } else { $divisor = "1"; } + - discover_temperature($valid_temp, $device, $oid, $index, "cisco-entity-sensor", $descr, "1", NULL, NULL, $current); + discover_temperature($valid_temp, $device, $oid, $index, "cisco-entity-sensor", $descr, $divisor, NULL, NULL, $current); } } } diff --git a/includes/polling/device-ios.inc.php b/includes/polling/device-ios.inc.php index ecf2607be0..af14a96074 100755 --- a/includes/polling/device-ios.inc.php +++ b/includes/polling/device-ios.inc.php @@ -31,6 +31,14 @@ $ciscomodel = str_replace("\"","",$ciscomodel); if($ciscomodel) { $hardware = $ciscomodel; unset($ciscomodel); } + if(strpos($sysDescr, "IOS XR")) { + list(,$version) = explode(",", $sysDescr); + $version = trim($version); + list(,$version) = explode(" ", $version); + list($version) = explode("\n", $version); + trim($version); + } + $cpu5m = shell_exec($config['snmpget'] . " -M ".$config['mibdir'] . " -m OLD-CISCO-CPU-MIB -O qv -$snmpver -c $community $hostname:$port avgBusy5.0"); $cpu5m = $cpu5m + 0; diff --git a/includes/polling/ports.inc.php b/includes/polling/ports.inc.php index 5ec0ff2e7b..24add53580 100755 --- a/includes/polling/ports.inc.php +++ b/includes/polling/ports.inc.php @@ -31,6 +31,7 @@ foreach ($ifmib_oids as $oid) { echo("$oid "); $array = snmp_cache_oid($oid, $device, $array, "IF-MIB");} if($config['enable_ports_etherlike']) { echo("dot3Stats "); $array = snmp_cache_oid("dot3StatsEntry", $device, $array, "EtherLike-MIB"); } + if($config['enable_ports_adsl']) { echo("adsl "); $array = snmp_cache_oid(".1.3.6.1.2.1.10.94.1.1", $device, $array, "ADSL-LINE-MIB"); } echo("\n"); @@ -198,6 +199,8 @@ /// Do EtherLike-MIB if($config['enable_ports_etherlike']) { include("port-etherlike.inc.php"); } + if($config['enable_ports_adsl']) { include("port-adsl.inc.php"); } + // Update MySQL if ($update) {