Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    SNMP::Info 2.08

    Download button

    No screenshots available
    Downloads: 514  Tell us about an update
    User Rating:
    Rated by:
    Good (3.2/5)
    14 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Max Baker | More programs
    Perl Artistic License / FREE
    September 22nd, 2012, 15:08 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    SNMP::Info description

    An Object Oriented Perl interface to network devices and MIBs through SNMP

    SNMP::Info is an Object Oriented Perl interface to network devices and MIBs through SNMP.

    SYNOPSIS

    use SNMP::Info;

    my $info = new SNMP::Info(
    # Auto Discover more specific Device Class
    AutoSpecify => 1,
    Debug => 1,
    # The rest is passed to SNMP::Session
    DestHost => 'router',
    Community => 'public',
    Version => 2
    ) or die "Can't connect to device.n";

    my $err = $info->error();
    die "SNMP Community or Version probably wrong connecting to device. $errn" if defined $err;

    $name = $info->name();
    $class = $info->class();
    print "SNMP::Info is using this device class : $classn";

    # Find out the Duplex status for the ports
    my $interfaces = $info->interfaces();
    my $i_duplex = $info->i_duplex();

    # Get CDP Neighbor info
    my $c_if = $info->c_if();
    my $c_ip = $info->c_ip();
    my $c_port = $info->c_port();

    # Print out data per port
    foreach my $iid (keys %$interfaces){
    my $duplex = $i_duplex->{$iid};
    # Print out physical port name, not snmp iid
    my $port = $interfaces->{$iid};

    print "$port: ";
    print "$duplex duplex" if defined $duplex;

    # The CDP Table has table entries different than the interface tables.
    # So we use c_if to get the map from cdp table to interface table.

    my %c_map = reverse %$c_if;
    my $c_key = $c_map{$iid};
    unless (defined $c_key) {
    print "nn";
    next;
    }
    my $neighbor_ip = $c_ip->{$c_key};
    my $neighbor_port = $c_port->{$c_key};

    print " connected to $neighbor_ip / $neighbor_portn" if defined $neighbor_ip;
    print "n";

    }


    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    network devices | Perl interface | Perl module | network | devices | Perl

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM