Net::SNMP how to specify hex in set_request
From: Ben Thompson (bt4_at_york.ac.uk)
Date: 03/26/04
- Previous message: Steve Kelem: "problems with cpan 1.76"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 26 Mar 2004 09:01:22 +0000
Hi
I would like to send a hex value set request using the Net::SNMP perl
module (do do with modifying vlans on a HP switch). Using net-snmp I
can issue the following command :
# snmpset hostname dot1qVlanStaticEgressPorts.1 x 'ffbfffc0'
I would like to do the same thing from a perl module, but so far I have
not had any success. The main problem I think is that I don't know how
to specify that I want to send a value in hex. Would someone be able to
offer me some advice?
Many Thanks
Ben
code :-
#!/usr/bin/perl
use strict;
use Net::SNMP;
my $community_string = "whatever";
my $dot1qVlanStaticEgressPorts = "1.3.6.1.2.1.17.7.1.4.3.1.2";
my $switch_ip_address = "i will put the ip address in here"
# Initialise "session" object with ip address and community string
my ($session, $error) = Net::SNMP->session(Hostname =>
$switch_ip_address, Community => $community_string);
die "session error: $error" unless ($session);
my $result = $session->set_request("$dot1qVlanStaticEgressPorts.1",
???????????????, 0xffbfffc0);
die "set_request error: ".$session->error unless (defined $result);
$session->close;
- Previous message: Steve Kelem: "problems with cpan 1.76"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|