sid3windr updates!

git-svn-id: http://www.observium.org/svn/observer/trunk@588 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2010-01-03 20:13:10 +00:00
parent 5877e94093
commit ce9ddb4ae5
8 changed files with 98 additions and 75 deletions
+2 -2
View File
@@ -24,7 +24,7 @@
$peerlist[] = $device['device_id'] ." $peer_ip";
$astext = trim(str_replace("\"", "", shell_exec("/usr/bin/dig +short AS$peer_as.asn.cymru.com TXT | cut -d '|' -f 5 | sed s/\\\"//g")));
$astext = get_astext($peer_pas);
# echo(str_pad($peer_ip, 40) . " AS$peer_as ");
@@ -81,7 +81,7 @@
$peerlist[] = $device['device_id'] ." $peer_ip";
$astext = trim(str_replace("\"", "", shell_exec("/usr/bin/dig +short AS$peer_as.asn.cymru.com TXT | cut -d '|' -f 5 | sed s/\\\"//g")));
$astext = get_astext($peer_as);
#echo("$peer_ip AS$peer_as ");
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `bgpPeers` WHERE `device_id` = '".$device['device_id']."' AND bgpPeerIdentifier = '$peer_ip'"),0) < '1') {
+1 -1
View File
@@ -11,7 +11,7 @@
if($data) {
$data = trim($data);
list($oid,$hrStorageIndex) = explode(" ", $data);
$temp = shell_exec($config['snmpget'] . " -m HOST-RESOURCES-MIB:HOST-RESOURCES-TYPES -O qv -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'] . " hrStorageDescr.$oid hrStorageAllocationUnits.$oid hrStorageSize.$oid hrStorageType.$oid");
$temp = shell_exec($config['snmpget'] . " -m HOST-RESOURCES-MIB:HOST-RESOURCES-TYPES -O sqv -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'] . " hrStorageDescr.$oid hrStorageAllocationUnits.$oid hrStorageSize.$oid hrStorageType.$oid");
$temp = trim($temp);
list($descr, $units, $size, $fstype) = explode("\n", $temp);
list($units) = explode(" ", $units);
+11
View File
@@ -696,6 +696,10 @@ function discover_process_ipv6($ifIndex,$ipv6_address,$ipv6_prefixlen,$ipv6_orig
$ipv6_network = trim(shell_exec($config['sipcalc']." $ipv6_address/$ipv6_prefixlen | grep Subnet | cut -f 2 -d '-'"));
$ipv6_compressed = trim(shell_exec($config['sipcalc']." $ipv6_address/$ipv6_prefixlen | grep Compressed | cut -f 2 -d '-'"));
$ipv6_type = trim(shell_exec($config['sipcalc']." $ipv6_address/$ipv6_prefixlen | grep \"Address type\" | cut -f 2- -d '-'"));
if ($ipv6_type == "Link-Local Unicast Addresses") return; # ignore link-locals (coming from IPV6-MIB)
if (mysql_result(mysql_query("SELECT count(*) FROM `interfaces`
WHERE device_id = '".$device['device_id']."' AND `ifIndex` = '$ifIndex'"), 0) != '0' && $ipv6_prefixlen > '0' && $ipv6_prefixlen < '129' && $ipv6_compressed != '::1') {
@@ -746,4 +750,11 @@ function duration($seconds, $max_periods = 6)
return implode(' ', $duration);
}
function get_astext($asn)
{
$result = dns_get_record("AS$asn.asn.cymru.com",DNS_TXT);
$txt = explode('|',$result[0]['txt']);
return trim(str_replace('"', '', $txt[4]));
}
?>
+3 -1
View File
@@ -24,7 +24,9 @@
} elseif ($device['os'] == "linux") {
list(,,$version) = explode (" ", $sysDescr);
if(strstr($sysDescr, "386")|| strstr($sysDescr, "486")||strstr($sysDescr, "586")||strstr($sysDescr, "686")) { $hardware = "Generic x86"; }
if(strstr($sysDescr, "x86_64")) { $hardware = "Generic x86 64-bit"; }
else if(strstr($sysDescr, "x86_64")) { $hardware = "Generic x86 64-bit"; }
else if(strstr($sysDescr, "sparc32")) { $hardware = "Generic SPARC 32-bit"; }
else if(strstr($sysDescr, "sparc64")) { $hardware = "Generic SPARC 64-bit"; }
$cmd = $config['snmpget'] . " -m UCD-SNMP-MIB -O qv -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port']. " .1.3.6.1.4.1.2021.7890.1.3.1.1.6.100.105.115.116.114.111";
$features = trim(`$cmd`);
$features = str_replace("No Such Object available on this agent at this OID", "", $features);