SNMP Problem


 
Thread Tools Search this Thread
Special Forums IP Networking SNMP Problem
# 1  
Old 06-10-2011
SNMP Problem

Hi, basically I'm just looking at the O'Reilly book 'Essential SNMP' and am following one of the examples. The code in the example is:

Code:
#!/usr/bin/perl
use SNMP::Util;
my $MIB1 = $ARGV[0];
my $HOST = $ARGV[1];
($MIB1) && ($HOST) || die "Usage: $0 MIB_OID HOSTNAME";
my $value = &snmpget("$HOST","$MIB1");
if ($value) { print "Results :$MIB1: :$value:\n"; }
else { warn "No response from host :$HOST:\n"; }

And the errors I'm getting are:

Code:
"my" variable $value masks earlier declaration in same statement at /usr/perl5/5.8.4/lib/SNMP/Util.pm line 804.
"my" variable @oid_names masks earlier declaration in same statement at /usr/perl5/5.8.4/lib/SNMP/Util.pm line 1636.
Undefined subroutine &main::snmpget called at ./snmpTest line 8.

Any ideas?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Need to transfer all kernel logs (var/log/messages) to the snmp listener as snmp trap

i am working with embedded system -Dell DCS management sub system. my question is as below: currently we are using linux kernel 2.6.30 build and we have a kernel logs stored to the /var/log/messages path. now we have to transfer all this logs to the specified SNMP target as a part of SNMP... (4 Replies)
Discussion started by: vipul_prajapati
4 Replies

2. Shell Programming and Scripting

Perl snmp script problem

does anyone know why this isn't showing me any output? #!/usr/bin/perl use strict; use Net::SNMP; my $host = 'localhost'; my $community = 'public'; my $session; my $error; my $response = undef; ($session, $error) = Net::SNMP->session( -hostname => $host, -version => 2,... (0 Replies)
Discussion started by: SkySmart
0 Replies

3. UNIX for Dummies Questions & Answers

Cacti SNMP Generic OID template, NaN problem

Hello All, I have installed cacti and I have Nan values on created graph. I really appreciate any help. I have done the following: 1. Linux Ubuntu 12.04.2 LTS 64 bits 2. apt-get install cacti // the cacti Version 0.8.7i was installed 3. Accessed "http://MyIP/cacti/index.php" 4. Set SNMP... (0 Replies)
Discussion started by: AndreiM
0 Replies

4. Infrastructure Monitoring

SNMP traps to SNMP server

Dear Champs, I am new to unix, and need to configure linux server to send below traps to a SNMP server. Monitoring TRAP Disk Space Low Monitoring TRAP Memory Low Monitoring TRAP CPU high Monitoring TRAP Admin login/Logoff Please help me how to send this information to my SNMP server... (2 Replies)
Discussion started by: stavar
2 Replies

5. IP Networking

SNMP Problem - SNMP not getting to the agent.

I am having a problem with an SNMP event, and I am not sure where I should be looking to solve this problem. Description: There is an SNMP event in our system that for one reason or another is not getting sent out as an email because it is never getting to our SNMP agent. I see where the... (0 Replies)
Discussion started by: broberts
0 Replies

6. Red Hat

Sending data from DELL OMSA SNMP and Custom SNMP MIB to same UDP port 161

Hi , Currently DELL OMSA SNMP sends data through default udp port 161.I want my custom SNMP MIB also to send data in the same udp port 161.Whether its possible.If yes where to configure .I tried starting my custom MIB in udp port 161,but it throws port already in use.Kindly guide. (1 Reply)
Discussion started by: prabakar4all
1 Replies

7. IP Networking

Sending data from DELL OMSA SNMP and Custom SNMP MIB to same UDP port 161

Hi , Currently DELL OMSA SNMP sends data through default udp port 161.I want my custom SNMP MIB also to send data in the same udp port 161.Whether its possible.If yes where to configure .I tried starting my custom MIB in udp port 161,but it throws port already in use.Kindly guide. (0 Replies)
Discussion started by: prabakar4all
0 Replies

8. UNIX for Dummies Questions & Answers

Snmp Disk Problem = Negative Values

Ok, so i monitor disk space on remote machines using snmp. Works great for me. But whenever a particular partition happens to have Terabytes of data, snmp starts reporting negative values. Can someone please tell me how to get around this problem? The AllocationUnit is 512 bytes. Weird... (0 Replies)
Discussion started by: SkySmart
0 Replies

9. Infrastructure Monitoring

SNMP problem

Hi all I had the server, when i run the below snmp command in the server (CNORA4/10.86.33.18), it cant give me the result. # snmpwalk -v1 -ctestuser 10.86.33.18 hrProcessorLoad Timeout: No Response from 10.86.33.18 but when i run another command, it seem like ok # snmpwalk -v1 -ctestuser... (1 Reply)
Discussion started by: SmartAntz
1 Replies

10. Infrastructure Monitoring

Facing problem while configuring snmp

HI, I am facing these two errors while configuring snmp can any body guide me. vi /var/log/snmpd.log Error opening specified endpoint "udp:161" Server Exiting with code 1 i also tried bash-3.00# netstat -a | grep snm *.snmpd Idle bash-3.00# lsof -i :161 bash: lsof: command not... (2 Replies)
Discussion started by: nir1785
2 Replies
Login or Register to Ask a Question
Info::Layer2::HPVC(3pm) 				User Contributed Perl Documentation				   Info::Layer2::HPVC(3pm)

NAME
SNMP::Info::Layer2::HPVC - SNMP Interface to HP VirtualConnect Switches AUTHOR
Jeroen van Ingen SYNOPSIS
# Let SNMP::Info determine the correct subclass for you. my $hp = new SNMP::Info( AutoSpecify => 1, Debug => 1, DestHost => 'myswitch', Community => 'public', Version => 2 ) or die "Can't connect to DestHost. "; my $class = $hp->class(); print "SNMP::Info determined this device to fall under subclass : $class "; DESCRIPTION
Provides abstraction to the configuration information obtainable from a HP VirtualConnect Switch via SNMP. For speed or debugging purposes you can call the subclass directly, but not after determining a more specific class using the method above. my $hp = new SNMP::Info::Layer2::HPVC(...); Inherited Classes SNMP::Info::Layer2 Required MIBs HPVC-MIB CPQSINFO-MIB HPVCMODULE-MIB All required MIBs can be found in the netdisco-mibs package. GLOBALS
These are methods that return scalar value from SNMP $hp->os() Returns hpvc $hp->os_bin() "cpqHoFwVerVersion.1" $hp->os_ver() "cpqHoSWRunningVersion.1" $hp->serial() "cpqSiSysSerialNum.0" $hp->vendor() hp $hp->model() "cpqSiProductName.0" Globals imported from SNMP::Info::Layer2 See documentation in "GLOBALS" in SNMP::Info::Layer2 for details. TABLE METHODS
These are methods that return tables of information in the form of a reference to a hash. Overrides Table Methods imported from SNMP::Info::Layer2 See documentation in "TABLE METHODS" in SNMP::Info::Layer2 for details. MUNGES
SET METHODS
These are methods that provide SNMP set functionality for overridden methods or provide a simpler interface to complex set operations. See "SETTING DATA VIA SNMP" in SNMP::Info for general information on set operations. perl v5.12.4 2011-09-28 Info::Layer2::HPVC(3pm)