add CISCO-ENTITY-VENDORTYPE-OID-MIB, use it for entphysical. re-enable PAgP and VTP VLAN tracking.

git-svn-id: http://www.observium.org/svn/observer/trunk@2174 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2011-04-26 22:25:35 +00:00
parent 7293113ee2
commit c78bfc8a4d
5 changed files with 23623 additions and 14 deletions

View File

@@ -37,6 +37,8 @@ function printEntPhysical($ent, $level, $class)
echo("<strong>".$ent['entPhysicalModelName'] . "</strong> (".$ent['entPhysicalName'].")");
} elseif ($ent['entPhysicalModelName']) {
echo("<strong>".$ent['entPhysicalModelName'] . "</strong>");
} elseif (is_numeric($ent['entPhysicalName']) && $ent['entPhysicalVendorType']) {
echo("<strong>".$ent['entPhysicalName']." ".$ent['entPhysicalVendorType']."</strong>");
} elseif ($ent['entPhysicalName']) {
echo("<strong>".$ent['entPhysicalName']."</strong>");
} elseif ($ent['entPhysicalDescr']) {

View File

@@ -11,7 +11,7 @@
$entity_array = array();
echo(" entPhysicalEntry");
$entity_array = snmpwalk_cache_oid($device, "entPhysicalEntry", $entity_array, "ENTITY-MIB");
$entity_array = snmpwalk_cache_oid($device, "entPhysicalEntry", $entity_array, "ENTITY-MIB:CISCO-ENTITY-VENDORTYPE-OID-MIB");
echo(" entAliasMappingIdentifier");
$entity_array = snmpwalk_cache_twopart_oid($device, "entAliasMappingIdentifier", $entity_array, "ENTITY-MIB:IF-MIB");

View File

@@ -82,12 +82,13 @@ if ($device['os_group'] == "ios")
{
$port_stats = snmp_cache_portIfIndex ($device, $port_stats);
$port_stats = snmp_cache_portName ($device, $port_stats);
foreach ($pagp_oids as $oid) { $port_stats = snmpwalk_cache_oid($device, $oid, $port_stats, "CISCO-PAGP-MIB"); }
$data_oids[] = "portName";
/// FIXME Why is this commented out?
#$port_stats = snmpwalk_cache_oid($device, "vmVlan", $port_stats, "CISCO-VLAN-MEMBERSHIP-MIB");
#$port_stats = snmpwalk_cache_oid($device, "vlanTrunkPortEncapsulationOperType", $port_stats, "CISCO-VTP-MIB");
#$port_stats = snmpwalk_cache_oid($device, "vlanTrunkPortNativeVlan", $port_stats, "CISCO-VTP-MIB");
$port_stats = snmpwalk_cache_oid($device, "vmVlan", $port_stats, "CISCO-VLAN-MEMBERSHIP-MIB");
$port_stats = snmpwalk_cache_oid($device, "vlanTrunkPortEncapsulationOperType", $port_stats, "CISCO-VTP-MIB");
$port_stats = snmpwalk_cache_oid($device, "vlanTrunkPortNativeVlan", $port_stats, "CISCO-VTP-MIB");
}
$polled = time();

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env php
#!/usr/bin/php
<?php
include("includes/defaults.inc.php");
@@ -9,19 +9,15 @@ $search = $argv[1] . "$";
$data = trim(`cat ips-scanned.txt | grep alive | cut -d" " -f 1 | egrep $search`);
foreach (explode("\n", $data) as $ip)
{
foreach( explode("\n", $data) as $ip) {
$snmp = shell_exec("snmpget -t 0.2 -v2c -c ".$config['community']." $ip sysName.0");
if (strstr($snmp, "STRING"))
{
if(strstr($snmp, "STRING")) {
$hostname = trim(str_replace("SNMPv2-MIB::sysName.0 = STRING: ","", $snmp));
if (mysql_result(mysql_query("SELECT COUNT(device_id) FROM devices WHERE hostname = '$hostname'"),0) == '0')
{
if (gethostbyname($hostname) == gethostbyname($hostname.".".$config['mydomain'])) { $hostname = $hostname . ".".$config['mydomain']; }
if(mysql_result(mysql_query("SELECT COUNT(device_id) FROM devices WHERE hostname = '$hostname'"),0) == '0') {
if(gethostbyname($hostname) == gethostbyname($hostname.".".$config['mydomain'])) { $hostname = $hostname . ".".$config['mydomain']; }
addHost($hostname, $community, 'v2c');
echo("Adding $hostname \n");
}
}
}
?>