mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
important fixes to interface polling
git-svn-id: http://www.observium.org/svn/observer/trunk@312 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -17,9 +17,13 @@
|
||||
|
||||
$entry = trim($entry);
|
||||
list($ifIndex, $ifName) = explode("||", $entry);
|
||||
$ifDescr = $config['snmpget'] . " -O qv -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'] . " ifAlias.$ifIndex";
|
||||
|
||||
if($config['ifdescr'][$device['os']]) {
|
||||
$ifDescr = shell_exec($config['snmpget'] . " -O qv -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'] . " ifAlias.$ifIndex");
|
||||
$ifDescr = str_replace("No Such Object available on this agent at this OID", "", $ifDescr);
|
||||
$ifDescr = str_replace("No Such Instance currently exists at this OID", "", $ifDescr);
|
||||
} else { $ifDescr = trim(str_replace("\"", "", $ifName)); }
|
||||
|
||||
|
||||
if(!strstr($entry, "irtual")) {
|
||||
$ifName = trim(str_replace("\"", "", $ifName));
|
||||
|
||||
@@ -17,7 +17,6 @@ include_once($config['install_dir'] . "/includes/print-functions.php");
|
||||
include_once($config['install_dir'] . "/includes/billing-functions.php");
|
||||
include_once($config['install_dir'] . "/includes/cisco-entities.php");
|
||||
include_once($config['install_dir'] . "/includes/syslog.php");
|
||||
#include_once($config['install_dir'] . "/includes/ipv6-functions.php");
|
||||
|
||||
function mres($string) {
|
||||
// short function wrapper because the real one is stupidly long and ugly. aestetics.
|
||||
|
||||
@@ -19,27 +19,28 @@ while ($interface = mysql_fetch_array($interface_query)) {
|
||||
echo("Looking at " . $interface['ifDescr'] . " on " . $device['hostname'] . "\n");
|
||||
|
||||
$snmp_cmd = $config['snmpget'] . " -O qv -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'];
|
||||
$snmp_cmd .= " ifAdminStatus." . $interface['ifIndex'] . " ifOperStatus." . $interface['ifIndex'] . " ifAlias." . $interface['ifIndex'];
|
||||
$snmp_cmd .= " ifAdminStatus." . $interface['ifIndex'] . " ifOperStatus." . $interface['ifIndex'] . " ifAlias." . $interface['ifIndex'] . " ifName." . $interface['ifIndex'];
|
||||
|
||||
$snmp_output = trim(`$snmp_cmd`);
|
||||
$snmp_output = str_replace("No Such Object available on this agent at this OID", "", $snmp_output);
|
||||
$snmp_output = str_replace("No Such Instance currently exists at this OID", "", $snmp_output);
|
||||
$snmp_output = str_replace("\"", "", $snmp_output);
|
||||
|
||||
list($ifAdminStatus, $ifOperStatus, $ifAlias) = explode("\n", $snmp_output);
|
||||
list($ifAdminStatus, $ifOperStatus, $ifAlias, $ifName) = explode("\n", $snmp_output);
|
||||
|
||||
if ($ifAlias == " ") { $ifAlias = str_replace(" ", "", $ifAlias); }
|
||||
$ifAlias = trim(str_replace("\"", "", $ifAlias));
|
||||
$ifAlias = trim($ifAlias);
|
||||
$ifDescr = trim(str_replace("\"", "", $ifDescr));
|
||||
$ifDescr = trim($ifDescr);
|
||||
|
||||
if(!$ifDescr) { $ifDescr = $ifName; }
|
||||
|
||||
$older_rrdfile = "rrd/" . $device['hostname'] . "." . $interface['ifIndex'] . ".rrd";
|
||||
$rrdfile = $host_rrd . "/" . $interface['ifIndex'] . ".rrd";
|
||||
|
||||
if(is_file($older_rrdfile) && !is_file($rrdfile)) { rename($older_rrdfile, $rrdfile); echo("Moving $older_rrdfile to $rrdfile"); }
|
||||
|
||||
|
||||
|
||||
|
||||
if(!is_file($rrdfile)) {
|
||||
$woo = `rrdtool create $rrdfile \
|
||||
DS:INOCTETS:COUNTER:600:0:12500000000 \
|
||||
@@ -63,7 +64,6 @@ while ($interface = mysql_fetch_array($interface_query)) {
|
||||
|
||||
if( file_exists("includes/polling/interface-" . $device['os'] . ".php") ) { include("includes/polling/interface-" . $device['os'] . ".php"); }
|
||||
|
||||
|
||||
if ( $interface['ifAlias'] != $ifAlias ) {
|
||||
$update .= $seperator . "`ifAlias` = '$ifAlias'";
|
||||
$seperator = ", ";
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
<?php
|
||||
|
||||
## ifDescr whitelist (used instead of ifName)
|
||||
$config['ifdescr']['IOS'] = true;
|
||||
|
||||
##############################
|
||||
# No changes below this line #
|
||||
##############################
|
||||
|
||||
168
mibs/.index
168
mibs/.index
@@ -1,88 +1,88 @@
|
||||
NETSCREEN-SET-LOG-MIB NS-SET-LOG.mib
|
||||
NETSCREEN-ADDR-MIB NS-ADDR.mib
|
||||
CISCO-IETF-PW-ENET-MIB CISCO-IETF-PW-ENET-MIB.my
|
||||
NETSCREEN-SET-DHCP-MIB NS-SET-DHCP.mib
|
||||
CISCO-TCP-STD-CAPABILITY CISCO-TCP-STD-CAPABILITY.my
|
||||
ADSL-LINE-MIB ADSL-LINE-MIB.my
|
||||
NETSCREEN-IDS-MIB NS-IDS.mib
|
||||
NETSCREEN-SET-SNMP-MIB NS-SET-SNMP.mib
|
||||
NETSCREEN-VR-MIB NS-VR.mib
|
||||
NETSCREEN-VPN-MON-MIB NS-VPN-MON.mib
|
||||
CISCO-IETF-PW-ENET-CAPABILITY CISCO-IETF-PW-ENET-CAPABILITY.my
|
||||
MPLS-LSR-MIB MPLS-LSR-MIB.my
|
||||
NETSCREEN-VPN-PHASETWO-MIB NS-VPN-PH2.mib
|
||||
CISCO-IETF-ISIS-CAPABILITY CISCO-IETF-ISIS-CAPABILITY.my
|
||||
CISCO-TC-NO-U32 CISCO-TC-NO-U32.my
|
||||
NETSCREEN-POLICY-MIB NS-POLICY.mib
|
||||
NETSCREEN-TRAP-MIB NS-TRAPS.mib
|
||||
DIFFSERV-MIB-CAPABILITY DIFFSERV-MIB-CAPABILITY.my
|
||||
CISCO-IETF-PW-FR-MIB CISCO-IETF-PW-FR-MIB.my
|
||||
VPN-TC-STD-MIB VPN-TC-STD-MIB.my
|
||||
NETSCREEN-SET-URL-FILTER-MIB NS-SET-URL-FILTER.mib
|
||||
CISCO-IETF-PW-MIB CISCO-IETF-PW-MIB.my
|
||||
NETSCREEN-VR-BGP4-MIB NS-VR-BGP4.mib
|
||||
MPLS-VPN-MIB MPLS-VPN-MIB.my
|
||||
PerfHist-TC-MIB PerfHist-TC-MIB.my
|
||||
CISCO-IETF-PW-TC-MIB CISCO-IETF-PW-TC-MIB.my
|
||||
NETSCREEN-RIPv2-MIB NS-RIP.mib
|
||||
NETSCREEN-CERTIFICATE-MIB NS-VPN-CERT.mib
|
||||
NETSCREEN-NSRP-MIB NS-NSRP.mib
|
||||
INTEGRATED-SERVICES-MIB INTEGRATED-SERVICES-MIB.my
|
||||
DIFFSERV-MIB DIFFSERV-MIB.my
|
||||
NETSCREEN-CHASSIS-MIB NS-CHASSIS.mib
|
||||
CISCO-VTP-MIB CISCO-VTP-MIB.my
|
||||
NETSCREEN-BGP4-MIB NS-BGP4.mib
|
||||
CISCO-IETF-PW-CAPABILITY CISCO-IETF-PW-CAPABILITY.my
|
||||
CISCO-VTP-CAPABILITY CISCO-VTP-CAPABILITY.my
|
||||
MPLS-LSR-STD-MIB MPLS-LSR-STD-MIB.my
|
||||
NETSCREEN-PRODUCTS-MIB NS-PRODUCTS.mib
|
||||
NETSCREEN-VR-OSPF-MIB NS-VR-OSPF.mib
|
||||
NETSCREEN-VPN-MON-SA-COUNT-MIB NS-VPN-MON-SA.mib
|
||||
NETSCREEN-ZONE-MIB NS-ZONE.mib
|
||||
MPLS-L3VPN-STD-MIB MPLS-L3VPN-STD-MIB.my
|
||||
CISCO-IETF-PW-MPLS-MIB CISCO-IETF-PW-MPLS-MIB.my
|
||||
CISCO-TCP-MIB CISCO-TCP-MIB.my
|
||||
NETSCREEN-SET-GEN-MIB NS-SET-GEN.mib
|
||||
NETSCREEN-SET-DNS-MIB NS-SET-DNS.mib
|
||||
NETSCREEN-OSPF-MIB NS-OSPF.mib
|
||||
CISCO-IF-EXTENSION-CAPABILITY CISCO-IF-EXTENSION-CAPABILITY.my
|
||||
BGP4-MIB BGP4-MIB.my
|
||||
CISCO-TC CISCO-TC.my
|
||||
NETSCREEN-VPN-MANUAL-MIB NS-VPN-MANUAL.mib
|
||||
NETSCREEN-SET-EMAIL-MIB NS-SET-EMAIL.mib
|
||||
NETSCREEN-VPN-PHASEONE-MIB NS-VPN-PH1.mib
|
||||
CISCO-SMI CISCO-SMI.my
|
||||
NETSCREEN-VPN-USER-MIB NS-VPN-USR.mib
|
||||
CISCO-MVPN-MIB CISCO-MVPN-MIB.my
|
||||
CISCO-IF-EXTENSION-MIB CISCO-IF-EXTENSION-MIB.my
|
||||
NETSCREEN-VPN-L2TP-MIB NS-VPN-L2TP.mib
|
||||
NETSCREEN-SERVICE-MIB NS-SERVICE.mib
|
||||
NETSCREEN-SET-ADMIN-USR-MIB NS-SET-ADMIN-USR.mib
|
||||
NETSCREEN-IP-ARP-MIB NS-IP-ARP.mib
|
||||
NETSCREEN-SET-AUTH-MIB NS-SET-AUTH.mib
|
||||
NETSCREEN-NAT-MIB NS-NAT.mib
|
||||
OSPF-MIB OSPF-MIB.my
|
||||
NETSCREEN-SET-GLB-MIB NS-SET-GLB.mib
|
||||
DIFFSERV-DSCP-TC DIFFSERV-DSCP-TC.my
|
||||
NETSCREEN-QOS-MIB NS-QOS.mib
|
||||
NETSCREEN-VPN-IAS-MIB NS-VPN-IAS.mib
|
||||
MPLS-TC-STD-MIB MPLS-TC-STD-MIB.my
|
||||
NETSCREEN-IPPOOL-MIB NS-VPN-IPPOOL.mib
|
||||
MPLS-LSR-MIB-CAPABILITY MPLS-LSR-MIB-CAPABILITY.my
|
||||
NETSCREEN-VPN-IKE-MIB NS-VPN-IKE.mib
|
||||
NETSCREEN-INTERFACE-MIB NS-INTERFACE.mib
|
||||
NETSCREEN-VR-RIPv2-MIB NS-VR-RIP.mib
|
||||
ENTITY-MIB ENTITY-MIB.txt
|
||||
CISCO-IETF-ISIS-MIB CISCO-IETF-ISIS-MIB.my
|
||||
CISCO-TCPOFFLOAD-MIB CISCO-TCPOFFLOAD-MIB.my
|
||||
NETSCREEN-SMI NS-SMI.mib
|
||||
NETSCREEN-VPN-GATEWAY-MIB NS-VPN-GW.mib
|
||||
NETSCREEN-SCHEDULE-MIB NS-SCHEDULE.mib
|
||||
CISCO-VTP-MIB CISCO-VTP-MIB.my
|
||||
NETSCREEN-SET-WEB-MIB NS-SET-WEB.mib
|
||||
NETSCREEN-OSPF-TRAP-MIB NS-OSPF-TRAP.mib
|
||||
CISCO-TCP-CAPABILITY CISCO-TCP-CAPABILITY.my
|
||||
NETSCREEN-VSYS-MIB NS-VSYS.mib
|
||||
CISCO-IETF-PW-MPLS-CAPABILITY CISCO-IETF-PW-MPLS-CAPABILITY.my
|
||||
NETSCREEN-RESOURCE-MIB NS-RES.mib
|
||||
NETSCREEN-SET-URL-FILTER-MIB NS-SET-URL-FILTER.mib
|
||||
VRRP-MIB VRRP-MIB.my
|
||||
NETSCREEN-OSPF-MIB NS-OSPF.mib
|
||||
CISCO-TC-NO-U32 CISCO-TC-NO-U32.my
|
||||
CISCO-IF-EXTENSION-MIB CISCO-IF-EXTENSION-MIB.my
|
||||
CISCO-IETF-PW-MPLS-CAPABILITY CISCO-IETF-PW-MPLS-CAPABILITY.my
|
||||
MPLS-LSR-MIB MPLS-LSR-MIB.my
|
||||
NETSCREEN-INTERFACE-MIB NS-INTERFACE.mib
|
||||
NETSCREEN-SET-SNMP-MIB NS-SET-SNMP.mib
|
||||
NETSCREEN-SMI NS-SMI.mib
|
||||
MPLS-VPN-MIB MPLS-VPN-MIB.my
|
||||
NETSCREEN-RIPv2-MIB NS-RIP.mib
|
||||
NETSCREEN-SET-AUTH-MIB NS-SET-AUTH.mib
|
||||
NETSCREEN-BGP4-MIB NS-BGP4.mib
|
||||
ADSL-LINE-MIB ADSL-LINE-MIB.my
|
||||
NETSCREEN-VPN-MON-SA-COUNT-MIB NS-VPN-MON-SA.mib
|
||||
ENTITY-MIB ENTITY-MIB.txt
|
||||
NETSCREEN-IP-ARP-MIB NS-IP-ARP.mib
|
||||
NETSCREEN-SET-DHCP-MIB NS-SET-DHCP.mib
|
||||
CISCO-TCP-MIB CISCO-TCP-MIB.my
|
||||
NETSCREEN-VR-MIB NS-VR.mib
|
||||
CISCO-SMI CISCO-SMI.my
|
||||
NETSCREEN-ZONE-MIB NS-ZONE.mib
|
||||
NETSCREEN-VR-RIPv2-MIB NS-VR-RIP.mib
|
||||
NETSCREEN-CERTIFICATE-MIB NS-VPN-CERT.mib
|
||||
CISCO-IETF-PW-FR-MIB CISCO-IETF-PW-FR-MIB.my
|
||||
NETSCREEN-VPN-MANUAL-MIB NS-VPN-MANUAL.mib
|
||||
NETSCREEN-VPN-L2TP-MIB NS-VPN-L2TP.mib
|
||||
CISCO-TCP-CAPABILITY CISCO-TCP-CAPABILITY.my
|
||||
NETSCREEN-VPN-PHASEONE-MIB NS-VPN-PH1.mib
|
||||
NETSCREEN-SCHEDULE-MIB NS-SCHEDULE.mib
|
||||
CISCO-IF-EXTENSION-CAPABILITY CISCO-IF-EXTENSION-CAPABILITY.my
|
||||
CISCO-IETF-PW-ENET-MIB CISCO-IETF-PW-ENET-MIB.my
|
||||
NETSCREEN-NAT-MIB NS-NAT.mib
|
||||
NETSCREEN-ADDR-MIB NS-ADDR.mib
|
||||
NETSCREEN-SET-DNS-MIB NS-SET-DNS.mib
|
||||
NETSCREEN-RESOURCE-MIB NS-RES.mib
|
||||
CISCO-TC CISCO-TC.my
|
||||
NETSCREEN-SET-GLB-MIB NS-SET-GLB.mib
|
||||
VPN-TC-STD-MIB VPN-TC-STD-MIB.my
|
||||
CISCO-IETF-PW-MIB CISCO-IETF-PW-MIB.my
|
||||
CISCO-IETF-ISIS-MIB CISCO-IETF-ISIS-MIB.my
|
||||
NETSCREEN-IPPOOL-MIB NS-VPN-IPPOOL.mib
|
||||
MPLS-LSR-STD-MIB MPLS-LSR-STD-MIB.my
|
||||
DIFFSERV-MIB DIFFSERV-MIB.my
|
||||
NETSCREEN-VPN-IAS-MIB NS-VPN-IAS.mib
|
||||
CISCO-VTP-CAPABILITY CISCO-VTP-CAPABILITY.my
|
||||
CISCO-TCP-STD-CAPABILITY CISCO-TCP-STD-CAPABILITY.my
|
||||
CISCO-IETF-PW-MPLS-MIB CISCO-IETF-PW-MPLS-MIB.my
|
||||
NETSCREEN-VPN-MON-MIB NS-VPN-MON.mib
|
||||
OSPF-MIB OSPF-MIB.my
|
||||
NETSCREEN-VPN-GATEWAY-MIB NS-VPN-GW.mib
|
||||
CISCO-IETF-PW-CAPABILITY CISCO-IETF-PW-CAPABILITY.my
|
||||
NETSCREEN-NSRP-MIB NS-NSRP.mib
|
||||
MPLS-L3VPN-STD-MIB MPLS-L3VPN-STD-MIB.my
|
||||
NETSCREEN-VR-OSPF-MIB NS-VR-OSPF.mib
|
||||
NETSCREEN-SET-SYSTIME-MIB NS-SET-SYSTIME.mib
|
||||
DIFFSERV-MIB-CAPABILITY DIFFSERV-MIB-CAPABILITY.my
|
||||
NETSCREEN-IDS-MIB NS-IDS.mib
|
||||
CISCO-MVPN-MIB CISCO-MVPN-MIB.my
|
||||
NETSCREEN-SET-GEN-MIB NS-SET-GEN.mib
|
||||
CISCO-IETF-ISIS-CAPABILITY CISCO-IETF-ISIS-CAPABILITY.my
|
||||
DIFFSERV-DSCP-TC DIFFSERV-DSCP-TC.my
|
||||
NETSCREEN-SET-EMAIL-MIB NS-SET-EMAIL.mib
|
||||
BGP4-MIB BGP4-MIB.my
|
||||
NETSCREEN-PRODUCTS-MIB NS-PRODUCTS.mib
|
||||
NETSCREEN-OSPF-TRAP-MIB NS-OSPF-TRAP.mib
|
||||
NETSCREEN-VSYS-MIB NS-VSYS.mib
|
||||
NETSCREEN-VPN-IKE-MIB NS-VPN-IKE.mib
|
||||
NETSCREEN-VPN-USER-MIB NS-VPN-USR.mib
|
||||
CISCO-TCPOFFLOAD-MIB CISCO-TCPOFFLOAD-MIB.my
|
||||
CISCO-IETF-PW-TC-MIB CISCO-IETF-PW-TC-MIB.my
|
||||
NETSCREEN-SET-LOG-MIB NS-SET-LOG.mib
|
||||
CISCO-IETF-PW-ENET-CAPABILITY CISCO-IETF-PW-ENET-CAPABILITY.my
|
||||
NETSCREEN-SET-ADMIN-USR-MIB NS-SET-ADMIN-USR.mib
|
||||
INTEGRATED-SERVICES-MIB INTEGRATED-SERVICES-MIB.my
|
||||
NETSCREEN-TRAP-MIB NS-TRAPS.mib
|
||||
PerfHist-TC-MIB PerfHist-TC-MIB.my
|
||||
MPLS-LSR-MIB-CAPABILITY MPLS-LSR-MIB-CAPABILITY.my
|
||||
NETSCREEN-CHASSIS-MIB NS-CHASSIS.mib
|
||||
NETSCREEN-VR-BGP4-MIB NS-VR-BGP4.mib
|
||||
NETSCREEN-QOS-MIB NS-QOS.mib
|
||||
NETSCREEN-SERVICE-MIB NS-SERVICE.mib
|
||||
NETSCREEN-POLICY-MIB NS-POLICY.mib
|
||||
NETSCREEN-VPN-PHASETWO-MIB NS-VPN-PH2.mib
|
||||
|
||||
Reference in New Issue
Block a user