migrate all SNMP calls to use $config['mibdir']. automatically generated from install_dir if not present

git-svn-id: http://www.observium.org/svn/observer/trunk@1284 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2010-07-02 19:58:13 +00:00
parent b991efa9a6
commit c22e8493f7
53 changed files with 168 additions and 128 deletions

View File

@@ -7,7 +7,7 @@ if($config['enable_pseudowires'] && $device['os_group'] == "ios") {
echo("Cisco Pseudowires : ");
$oids = shell_exec($config['snmpwalk'] . " -m CISCO-IETF-PW-MIB -CI -Ln -Osqn -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'] . " cpwVcID");
$oids = shell_exec($config['snmpwalk'] . " -M " . $config['mibdir'] . " -m CISCO-IETF-PW-MIB -CI -Ln -Osqn -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'] . " cpwVcID");
$oids = str_replace(".1.3.6.1.4.1.9.10.106.1.2.1.10.", "", $oids);
@@ -16,8 +16,8 @@ if($config['enable_pseudowires'] && $device['os_group'] == "ios") {
if($oid) {
list($cpwOid, $cpwVcID) = explode(" ", $oid);
if($cpwOid) {
list($cpw_remote_id) = split(":", shell_exec($config['snmpget'] . " -m CISCO-IETF-PW-MPLS-MIB -Ln -Osqnv -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'] . " cpwVcMplsPeerLdpID." . $cpwOid));
$interface_descr = trim(shell_exec($config['snmpwalk'] . " -m CISCO-IETF-PW-MIB -Oqvn -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'] . " cpwVcName." . $cpwOid));
list($cpw_remote_id) = split(":", shell_exec($config['snmpget'] . " -M " . $config['mibdir'] . " -m CISCO-IETF-PW-MPLS-MIB -Ln -Osqnv -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'] . " cpwVcMplsPeerLdpID." . $cpwOid));
$interface_descr = trim(shell_exec($config['snmpwalk'] . " -M " . $config['mibdir'] . " -m CISCO-IETF-PW-MIB -Oqvn -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'].":".$device['port'] . " cpwVcName." . $cpwOid));
$cpw_remote_device = @mysql_result(mysql_query("SELECT device_id FROM ipv4_addresses AS A, ports AS I WHERE A.ipv4_address = '".$cpw_remote_id."' AND A.interface_id = I.interface_id"),0);
$if_id = @mysql_result(mysql_query("SELECT `interface_id` FROM `ports` WHERE `ifDescr` = '$interface_descr' AND `device_id` = '".$device['device_id']."'"),0);
if($cpw_remote_device && $if_id) {