#!/usr/local/bin/perl

#Check for SNMP Values

use BER;					
require 'SNMP_Session.pm';

#Variables
$host=@ARGV[0] || die "usage";
$community=@ARGV[1] || 'public';
$port='161';
 
$session = SNMP_Session->open ($host, $community, $port)
        || die "Couldn't open SNMP session to $host";


#Oid's
$oid1=encode_oid (1,3,6,1,2,1,1,5,0);

if ($session->get_request_response ($oid1)){
	($bindings) = $session->decode_get_response
($session->{pdu_buffer});

        while ($bindings ne '') {
              ($binding,$bindings) = &decode_sequence ($bindings);
              ($oid,$value) = &decode_by_template ($binding, "%O%@");
              print $pretty_oids{$oid}," => ",
                    &pretty_print ($value), "\n";
        }
} else {
        die "No response from agent on $host";
}
