git-svn-id: http://www.observium.org/svn/observer/trunk@608 61d68cd4-352d-0410-923a-c4978735b2b8

This commit is contained in:
Adam Amstrong
2010-01-07 16:46:55 +00:00
parent ededf43109
commit d06a4922fd
3 changed files with 12 additions and 5 deletions

View File

@@ -77,6 +77,10 @@ while ($device = mysql_fetch_array($device_query)) {
## hr-device.inc.php
include("includes/discovery/hr-device.inc.php");
## CDP & LLDP
include("includes/discovery/cdp-lldp.inc.php");
if($device['os'] == "netscreen") {
if ($device['type'] == "unknown") { $device['type'] = 'firewall'; }
}
@@ -95,7 +99,6 @@ while ($device = mysql_fetch_array($device_query)) {
include("includes/discovery/cisco-processors.php");
include("includes/discovery/cemp-mib.php");
include("includes/discovery/cmp-mib.php");
include("includes/discovery/cdp-lldp.inc.php");
if ($device['type'] == "unknown") { $device['type'] = 'network'; };
}
@@ -103,7 +106,6 @@ while ($device = mysql_fetch_array($device_query)) {
if ($device['os'] == "procurve" || $device['os'] == "powerconnect")
{
include("includes/discovery/q-bridge-mib.php");
include("includes/discovery/cdp-lldp.inc.php");
if ($device['type'] == "unknown") { $device['type'] = 'network'; };
}

View File

@@ -60,6 +60,11 @@ while($link = mysql_fetch_array($links)) {
$map .= "\"" . $sif['interface_id'] . "\" [label=\"" . $sif['label'] . "\", fontsize=12, fillcolor=lightblue URL=\"/device/".$device['device_id']."/interface/$src_if/\"]\n";
$map .= "\"$src\" -> \"" . $sif['interface_id'] . "\" [weight=500000, arrowsize=0, len=0];\n";
$map .= "\"$src$sif\" [label=\"$sif\", fontsize=12, fillcolor=lightblue URL=\"/device/".$device['device_id']."/interface/$src_if/\"]\n";
$map .= "\"$src\" -> \"$src$sif\" [weight=50000000, arrowsize=0, len=0];\n";
# $map .= "\"$src$sif\" -> \"$dst$dif\" [weight=1] \n";
$map .= "\"$dst\" [URL=\"/device/$dst_host/map/\" fontsize=20 shape=box3d]\n";
if($dst_host == $device['device_id']) {
@@ -69,8 +74,7 @@ while($link = mysql_fetch_array($links)) {
}
$map .= "\"" . $dif['interface_id'] . "\" -> \"$dst\" [weight=500000, arrowsize=0, len=0];\n";
$map .= "\"" . $sif['interface_id'] . "\" -> \"" . $dif['interface_id'] . "\" [weight=1, arrowhead=normal, arrowtail=normal, len=2, $info] \n";
$map .= "\"$dst$dif\" -> \"$dst\" [weight=50000000, arrowsize=0, len=0];\n";
}

View File

@@ -89,7 +89,7 @@ function snmpwalk_cache_twopart_oid($oid, $device, $array, $mib = 0) {
}
function snmpwalk_cache_threepart_oid($oid, $device, $array, $mib = 0) {
global $config;
global $config;$debug;
$cmd = $config['snmpbulkwalk'] . " -O Qs -" . $device['snmpver'] . " -c " . $device['community'] . " " .
$device['hostname'].":".$device['port'] . " ";
if($mib) { $cmd .= "-m $mib "; }
@@ -100,6 +100,7 @@ function snmpwalk_cache_threepart_oid($oid, $device, $array, $mib = 0) {
list($oid,$value) = explode("=", $entry);
$oid = trim($oid); $value = trim($value);
list($oid, $first, $second, $third) = explode(".", $oid);
if($debug) {echo("$entry || $oid || $first || $second || $third\n");}
if (!strstr($this_value, "at this OID") && isset($oid) && isset($first) && isset($second) && isset($third)) {
$array[$device_id][$first][$second][$third][$oid] = $value;
}