[rrd-users] Re: SNMP CLient

Leo Le lle at socccd.cc.ca.us
Thu Aug 5 19:03:42 MEST 1999


Hi Kevin,
Try http://www.switch.ch/misc/leinen/snmp/perl/
I got this from Cricket instruction. Thanks guys.
I tried the below script, but it is not working. While the smnpget in Tobi's
mrtg ( well, looks the same to me , except srand(); )  get the response. Can
someone show me some light here. I desperated. Thanks.
Leo Le
---------------------------------
$ more test.pl
#!/usr/local/bin/perl
use BER;
require 'SNMP_Session.pm';
#
#
$oid1='1.3.6.1.2.1.2.2.1.11.6';
$host='10.10.100.253';
$community='public';
$port='161';
$session=SNMP_Session->open ( $host, $community, $port ) || die "couldnotopen
$h
ost";
print " host $host   comm $community \n";
if ( $session->get_request_response ($oid1)) {
        $response=$session->pdu_buffer;
        ($bindings)=$session->decode_get_response ($response);
$session->close();
        while ( $bindings ne '' ) {
                ($binding, $bindings)=decode_sequence ($bindings);
                ($oid, $value)=decode_by_template ($binding, "%0%@");
                print $pretty_oids{$oid}, " => ",
                        &pretty_print ($value), "\n";
        }
} else {
        die " No response from $host";
}
-----------------------
$ test.pl
 host 10.10.100.253   comm public
SNMP Error:
no response received
SNMPv1_Session (remote host: "10.10.100.253" [10.10.100.253].161
                  community: "public"
                 request ID: 123864900
                PDU bufsize: 8000 bytes
                    timeout: 2s
                    retries: 5
                    backoff: 1)
 No response from 10.10.100.253 at ./test.pl line 23.
$


Kevin Fenn wrote:

>    Hi
>
> Wondering if anyone can help.  Does anyone know where i can get an
> snmpget client from.  The one i have does not work correctly .
>
> I'm using a sparc 10 with solaris 2.6
>
> Thanks in advance
>
> Kevin Fenn
> Nortel Networks
>
> --
> * To unsubscribe from the rrd-users mailing list, send a message with the
>   subject: unsubscribe to rrd-users-request at list.ee.ethz.ch

--
* To unsubscribe from the rrd-users mailing list, send a message with the
  subject: unsubscribe to rrd-users-request at list.ee.ethz.ch



More information about the rrd-users mailing list