Skip to content

Commit

Permalink
[IM] Some switches support MAU but not all of the MIBs
Browse files Browse the repository at this point in the history
  • Loading branch information
barryo committed Mar 11, 2015
1 parent bdc21a3 commit 57729a7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions application/Entities/SwitchPort.php
Expand Up @@ -605,10 +605,16 @@ public function snmpUpdate( $host, $logger = false )
$getfn = "get{$entity['fn']}";
$setfn = "set{$entity['fn']}";

if( isset( $entity['xlate'] ) )
$n = $host->useMAU()->$snmp( $entity['xlate'] )[ $this->getIfIndex() ];
else
$n = $host->useMAU()->$snmp()[ $this->getIfIndex() ];
try {
if( isset( $entity['xlate'] ) )
$n = $host->useMAU()->$snmp( $entity['xlate'] )[ $this->getIfIndex() ];
else
$n = $host->useMAU()->$snmp()[ $this->getIfIndex() ];
} catch( \OSS_SNMP\Exception $e ) {
// looks like the switch supports MAU but not all of the MIBs
$logger->debug( "[{$this->getSwitcher()->getName()}]:{$this->getName()} [Index: {$this->getIfIndex()}] MAU MIB for {$fn} not supported" );
$n = null;
}

if( $n == '*** UNKNOWN ***' && $snmp == 'types' )
$n = '(empty)';
Expand Down

0 comments on commit 57729a7

Please sign in to comment.