fixes to things, use *only* junos and junose mibdir for those things

git-svn-id: http://www.observium.org/svn/observer/trunk@1586 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2010-07-31 19:12:40 +00:00
parent 811d3ca6a1
commit ec74c22e3b
14 changed files with 55 additions and 33 deletions
+1 -1
View File
@@ -39,7 +39,7 @@ if ($config['enable_bgp'])
if ($device['os'] == "junos")
{
## Juniper BGP4-V2 MIB, ipv6 only for now, because v4 should be covered in BGP4-MIB above
$peers_cmd = $config['snmpwalk'] . " -M " . $config['mibdir'] . " -M +".$config['install_dir']."/mibs/junos -m BGP4-V2-MIB-JUNIPER -CI -Onq -" . $device['snmpver'] . " -c" . $device['community'] . " " . $device['hostname'].":".$device['port'] . " ";
$peers_cmd = $config['snmpwalk'] . " -M " . $config['mibdir'] . " -M ".$config['install_dir']."/mibs/junos -m BGP4-V2-MIB-JUNIPER -CI -Onq -" . $device['snmpver'] . " -c" . $device['community'] . " " . $device['hostname'].":".$device['port'] . " ";
$peers_cmd .= "jnxBgpM2PeerRemoteAs.0.ipv6"; # FIXME: is .0 the only possible value here?
$peers = trim(str_replace(".1.3.6.1.4.1.2636.5.1.1.2.1.1.1.13.0.","", `$peers_cmd`));
foreach (explode("\n", $peers) as $peer)
+1 -1
View File
@@ -8,7 +8,7 @@
if($device['os'] == "junose" && $config['enable_ports_junoseatmvp'])
{
echo("JunOSe ATM vps : ");
$vp_array = snmpwalk_cache_multi_oid($device, "juniAtmVpStatsInCells", $vp_array, "Juniper-UNI-ATM-MIB" , "+".$config['install_dir']."/mibs/junose");
$vp_array = snmpwalk_cache_multi_oid($device, "juniAtmVpStatsInCells", $vp_array, "Juniper-UNI-ATM-MIB" , $config['install_dir']."/mibs/junose");
$valid_vp = array();
if($debug) { print_r($vp_array); }
+3 -3
View File
@@ -6,9 +6,9 @@ global $valid_mempool;
if($device['os'] == "junos")
{
echo("JUNOS : ");
$mempools_array = snmpwalk_cache_multi_oid($device, "jnxOperatingBuffer", $mempools_array, "JUNIPER-MIB" , "+".$config['install_dir']."/mibs/junos");
$mempools_array = snmpwalk_cache_multi_oid($device, "jnxOperatingDRAMSize", $mempools_array, "JUNIPER-MIB" , "+".$config['install_dir']."/mibs/junos");
$mempools_array = snmpwalk_cache_multi_oid($device, "jnxOperatingDescr", $mempools_array, "JUNIPER-MIB" , "+".$config['install_dir']."/mibs/junos");
$mempools_array = snmpwalk_cache_multi_oid($device, "jnxOperatingBuffer", $mempools_array, "JUNIPER-MIB" , $config['install_dir']."/mibs/junos");
$mempools_array = snmpwalk_cache_multi_oid($device, "jnxOperatingDRAMSize", $mempools_array, "JUNIPER-MIB" , $config['install_dir']."/mibs/junos");
$mempools_array = snmpwalk_cache_multi_oid($device, "jnxOperatingDescr", $mempools_array, "JUNIPER-MIB" , $config['install_dir']."/mibs/junos");
if($debug) { print_r($mempools_array); }
if(is_array($mempools_array[$device['device_id']])) {
+1 -1
View File
@@ -6,7 +6,7 @@ global $valid_processor;
if($device['os'] == "junose")
{
echo("JUNOSe : ");
$processors_array = snmpwalk_cache_double_oid($device, "juniSystemModule", $processors_array, "Juniper-System-MIB" , "+".$config['install_dir']."/mibs/junose");
$processors_array = snmpwalk_cache_double_oid($device, "juniSystemModule", $processors_array, "Juniper-System-MIB" , $config['install_dir']."/mibs/junose");
if($debug) { print_r($processors_array); }
foreach ($processors_array[$device['device_id']] as $index => $entry)
@@ -5,7 +5,7 @@ global $valid_sensor;
if ($device['os'] == "junos" || $device['os_group'] == "junos")
{
echo("JunOS ");
$oids = snmp_walk($device,"1.3.6.1.4.1.2636.3.1.13.1.7","-Osqn","JUNIPER-MIB", '+'.$config['install_dir']."/mibs/junos");
$oids = snmp_walk($device,"1.3.6.1.4.1.2636.3.1.13.1.7","-Osqn","JUNIPER-MIB", $config['install_dir']."/mibs/junos");
$oids = trim($oids);
foreach(explode("\n", $oids) as $data)
{
@@ -7,7 +7,7 @@ global $valid_sensor;
if ($device['os'] == "junose")
{
echo("JunOSe: ");
$oids = snmpwalk_cache_multi_oid($device, "juniSystemTempValue", array(), "Juniper-System-MIB", "+".$config['install_dir']."/mibs/junose");
$oids = snmpwalk_cache_multi_oid($device, "juniSystemTempValue", array(), "Juniper-System-MIB", $config['install_dir']."/mibs/junose");
if(is_array($oids[$device['device_id']]))
{
foreach($oids[$device[device_id]] as $index => $entry)
+2 -2
View File
@@ -43,7 +43,7 @@ if ($device['os'] == "junos")
}
}
## FIX ME - move to function (and clean up, wtf?)
$peer_cmd = $config['snmpget'] . " -M ".$config['mibdir'] . ":".$config['mibdir'] . "/junos -m BGP4-V2-MIB-JUNIPER -Ovq -" . $device['snmpver'] . " -c" . $device['community'] . " " . $device['hostname'].":".$device['port'];
$peer_cmd = $config['snmpget'] . " -M ".$config['mibdir'] . "/junos -m BGP4-V2-MIB-JUNIPER -Ovq -" . $device['snmpver'] . " -c" . $device['community'] . " " . $device['hostname'].":".$device['port'];
$peer_cmd .= " jnxBgpM2PeerState.0.ipv6." . $junos_v6[$peer_ip];
$peer_cmd .= " jnxBgpM2PeerStatus.0.ipv6." . $junos_v6[$peer_ip]; # Should be jnxBgpM2CfgPeerAdminStatus but doesn't seem to be implemented?
$peer_cmd .= " jnxBgpM2PeerInUpdates.0.ipv6." . $junos_v6[$peer_ip];
@@ -53,7 +53,7 @@ if ($device['os'] == "junos")
$peer_cmd .= " jnxBgpM2PeerFsmEstablishedTime.0.ipv6." . $junos_v6[$peer_ip];
$peer_cmd .= " jnxBgpM2PeerInUpdatesElapsedTime.0.ipv6." . $junos_v6[$peer_ip];
$peer_cmd .= " jnxBgpM2PeerLocalAddr.0.ipv6." . $junos_v6[$peer_ip];
$peer_cmd .= ' -M"+' . $config['install_dir'] . '/mibs/junos"|grep -v "No Such Instance"';
$peer_cmd .= ' -M"' . $config['install_dir'] . '/mibs/junos"|grep -v "No Such Instance"';
if ($debug) echo "\n$peer_cmd\n";
$peer_data = trim(`$peer_cmd`);
list($bgpPeerState, $bgpPeerAdminStatus, $bgpPeerInUpdates, $bgpPeerOutUpdates, $bgpPeerInTotalMessages, $bgpPeerOutTotalMessages, $bgpPeerFsmEstablishedTime, $bgpPeerInUpdateElapsedTime, $bgpLocalAddr) = explode("\n", $peer_data);
+8 -8
View File
@@ -8,14 +8,14 @@ if(mysql_affected_rows()) {
$vp_cache = array();
$vp_cache = snmpwalk_cache_multi_oid($device, "juniAtmVpStatsInCells", $vp_cache, "Juniper-UNI-ATM-MIB" , "+".$config['install_dir']."/mibs/junose");
$vp_cache = snmpwalk_cache_multi_oid($device, "juniAtmVpStatsInPackets", $vp_cache, "Juniper-UNI-ATM-MIB" , "+".$config['install_dir']."/mibs/junose");
$vp_cache = snmpwalk_cache_multi_oid($device, "juniAtmVpStatsInPacketOctets", $vp_cache, "Juniper-UNI-ATM-MIB" , "+".$config['install_dir']."/mibs/junose");
$vp_cache = snmpwalk_cache_multi_oid($device, "juniAtmVpStatsInPacketErrors", $vp_cache, "Juniper-UNI-ATM-MIB" , "+".$config['install_dir']."/mibs/junose");
$vp_cache = snmpwalk_cache_multi_oid($device, "juniAtmVpStatsOutCells", $vp_cache, "Juniper-UNI-ATM-MIB" , "+".$config['install_dir']."/mibs/junose");
$vp_cache = snmpwalk_cache_multi_oid($device, "juniAtmVpStatsOutPackets", $vp_cache, "Juniper-UNI-ATM-MIB" , "+".$config['install_dir']."/mibs/junose");
$vp_cache = snmpwalk_cache_multi_oid($device, "juniAtmVpStatsOutPacketOctets", $vp_cache, "Juniper-UNI-ATM-MIB" , "+".$config['install_dir']."/mibs/junose");
$vp_cache = snmpwalk_cache_multi_oid($device, "juniAtmVpStatsOutPacketErrors", $vp_cache, "Juniper-UNI-ATM-MIB" , "+".$config['install_dir']."/mibs/junose");
$vp_cache = snmpwalk_cache_multi_oid($device, "juniAtmVpStatsInCells", $vp_cache, "Juniper-UNI-ATM-MIB" , $config['install_dir']."/mibs/junose");
$vp_cache = snmpwalk_cache_multi_oid($device, "juniAtmVpStatsInPackets", $vp_cache, "Juniper-UNI-ATM-MIB" , $config['install_dir']."/mibs/junose");
$vp_cache = snmpwalk_cache_multi_oid($device, "juniAtmVpStatsInPacketOctets", $vp_cache, "Juniper-UNI-ATM-MIB" , $config['install_dir']."/mibs/junose");
$vp_cache = snmpwalk_cache_multi_oid($device, "juniAtmVpStatsInPacketErrors", $vp_cache, "Juniper-UNI-ATM-MIB" , $config['install_dir']."/mibs/junose");
$vp_cache = snmpwalk_cache_multi_oid($device, "juniAtmVpStatsOutCells", $vp_cache, "Juniper-UNI-ATM-MIB" , $config['install_dir']."/mibs/junose");
$vp_cache = snmpwalk_cache_multi_oid($device, "juniAtmVpStatsOutPackets", $vp_cache, "Juniper-UNI-ATM-MIB" , $config['install_dir']."/mibs/junose");
$vp_cache = snmpwalk_cache_multi_oid($device, "juniAtmVpStatsOutPacketOctets", $vp_cache, "Juniper-UNI-ATM-MIB" , $config['install_dir']."/mibs/junose");
$vp_cache = snmpwalk_cache_multi_oid($device, "juniAtmVpStatsOutPacketErrors", $vp_cache, "Juniper-UNI-ATM-MIB" , $config['install_dir']."/mibs/junose");
$vp_cache = $vp_cache[$device[device_id]];
echo("Checking JunOSe ATM vps: ");
+2 -2
View File
@@ -7,8 +7,8 @@ if($debug) {echo("JunOS Mempool");}
if(!is_array($mempool_cache['junos'])) {
if($debug) {echo("caching");}
$mempool_cache['junos'] = array();
$mempool_cache['junos'] = snmpwalk_cache_multi_oid($device, "jnxOperatingBuffer", $mempool_cache['junos'], "JUNIPER-MIB" , "+".$config['install_dir']."/mibs/junos");
$mempool_cache['junos'] = snmpwalk_cache_multi_oid($device, "jnxOperatingDRAMSize", $mempool_cache['junos'], "JUNIPER-MIB" , "+".$config['install_dir']."/mibs/junos");
$mempool_cache['junos'] = snmpwalk_cache_multi_oid($device, "jnxOperatingBuffer", $mempool_cache['junos'], "JUNIPER-MIB" , $config['install_dir']."/mibs/junos");
$mempool_cache['junos'] = snmpwalk_cache_multi_oid($device, "jnxOperatingDRAMSize", $mempool_cache['junos'], "JUNIPER-MIB" , $config['install_dir']."/mibs/junos");
if($debug) {print_r($mempool_cache);}
}
+2 -2
View File
@@ -6,8 +6,8 @@ if(strpos($sysDescr, "olive")) {
$hardware = "Olive";
$serial = "";
} else {
$junose_hardware = snmp_get($device, "sysObjectID.0", "-Ovqs", "+Juniper-Products-MIB", "+".$config['install_dir']."/mibs/junose");
$junose_version = snmp_get($device, "juniSystemSwVersion.0", "-Ovqs", "+Juniper-System-MIB", "+".$config['install_dir']."/mibs/junose");
$junose_hardware = snmp_get($device, "sysObjectID.0", "-Ovqs", "+Juniper-Products-MIB", $config['install_dir']."/mibs/junose");
$junose_version = snmp_get($device, "juniSystemSwVersion.0", "-Ovqs", "+Juniper-System-MIB", $config['install_dir']."/mibs/junose");
$junose_serial = "";
$hardware = "Juniper " . rewrite_junose_hardware($junose_hardware);