Net::SNMP::Mixin::IfInfo - mixin class for interface related infos


Net-SNMP-Mixin-IfInfo documentation  | view source Contained in the Net-SNMP-Mixin-IfInfo distribution.

Index


NAME

Top

Net::SNMP::Mixin::IfInfo - mixin class for interface related infos

VERSION

Top

Version 0.05

SYNOPSIS

Top

  use Net::SNMP;
  use Net::SNMP::Mixin;

  my $session = Net::SNMP->session( -hostname => 'foo.bar.com' );

  $session->mixer('Net::SNMP::Mixin::IfInfo');
  $session->init_mixins;
  snmp_dispatcher();
  die $session->errors if $session->errors;

  my $if_entries = $session->get_if_entries;
  foreach my $if_index ( sort { $a <=> $b } keys %$if_entries ) {
    my $ifAdminStatus = $if_entries->{$if_index}->{ifAdminStatus} || 0;
    my $ifOperStatus  = $if_entries->{$if_index}->{ifOperStatus}  || 0;
    my $ifType        = $if_entries->{$if_index}->{ifType}        || 0;
    my $ifName        = $if_entries->{$if_index}->{ifName}        || '';
    my $ifDescr       = $if_entries->{$if_index}->{ifDescr}       || '';
    my $ifAlias       = $if_entries->{$if_index}->{ifAlias}       || '';

    printf "%5d  %1d/%1d  %-10.10s %-25.25s %-26.26s\n",
      $if_index, $ifAdminStatus, $ifOperStatus,
      $ifName,   $ifDescr,       $ifAlias;
  }

DESCRIPTION

Top

A mixin class for basic interface related infos from the ifTable and ifXTable.

This mixin supports the quasi static information from both tables together in one hash, see below.

MIXIN METHODS

Top

OBJ->get_if_entries

Returns parts ot the ifTable and ifXTable as a hash reference. The key is the common ifIndex into the ifTable and ifXtable:

  {
    INTEGER => {    # ifIndex as key

      ifName        => DisplayString,    # an ifXTable entry
      ifAlias       => DisplayString,    # an ifXTable entry

      ifDescr       => DisplayString,    # an ifTable entry
      ifType        => IANAifType,       # an ifTable entry
      ifAdminStatus => INTEGER,          # an ifTable entry
      ifOperStatus  => INTEGER,          # an ifTable entry
    }

    ... ,
  }

INITIALIZATION

Top

OBJ->_init($reload)

Fetch basic interface related snmp values from the host. Don't call this method direct!

PRIVATE METHODS

Top

Only for developers or maintainers.

_fetch_if_table_entries($session)

Get some MIB values from the ifTable needed by all other modules.

_if_table_entries_cb($session)

The callback for _fetch_if_table_entries

_fetch_if_x_table_entries($session)

Get some MIB values from the ifXTable needed by all other modules.

_if_x_table_entries_cb($session)

The callback for _fetch_if_x_table_entries

SEE ALSO

Top

Net::SNMP::Mixin::Dot1dBase for a mapping between ifIndexes and dot1dBasePorts.

REQUIREMENTS

Top

Net::SNMP, Net::SNMP::Mixin

BUGS, PATCHES & FIXES

Top

There are no known bugs at the time of this release. However, if you spot a bug or are experiencing difficulties that are not explained within the POD documentation, please submit a bug to the RT system (see link below). However, it would help greatly if you are able to pinpoint problems or even supply a patch.

Fixes are dependant upon their severity and my availablity. Should a fix not be forthcoming, please feel free to (politely) remind me by sending an email to gaissmai@cpan.org .

  RT: http://rt.cpan.org/Public/Dist/Display.html?Name=Net-SNMP-Mixin-IfInfo

AUTHOR

Top

Karl Gaissmaier <karl.gaissmaier at uni-ulm.de>

COPYRIGHT & LICENSE

Top


Net-SNMP-Mixin-IfInfo documentation  | view source Contained in the Net-SNMP-Mixin-IfInfo distribution.