#!/usr/bin/perl -w

use strict;
use warnings;
use SNMP;

$SNMP::debugging = 3;

my $sess = new SNMP::Session( DestHost => 'localhost', Community => 'public', Version => 2 );

my @vbl;

push @vbl, [ 'sysUpTime', 0 ];
push @vbl, [ 'sysName', 0 ];
push @vbl, [ 'sysLocation', 0 ];
push @vbl, [ 'sysContact', 0 ];

my $varlist = new SNMP::VarList(@vbl);

$sess->get($varlist);

print "ERROR WAS: ".$sess->{'ErrorStr'}."\n" if $sess->{'ErrorStr'};

foreach my $vb (@$varlist) {

  print "0:".$vb->[0]."\n";
  print "1:".$vb->[1]."\n";
  print "2:".$vb->[2]."\n";
  print "3:".$vb->[3]."\n";

}
