Discussion:
SNMPGET...[NET-SNMP-TUTORIAL-MIB::nstAgentModuleObject]
(too old to reply)
g***@bel.co.in
2010-02-22 03:33:00 UTC
Permalink
Hi,

i am facing trobles in using snmpget for more than oneweek.
Also i am not knowing whether i am doing mistakes in configuring agent(snmpd.


I am extending agent using microsoft visual c++.


what i have done is below.

1. i put NET-SNMP-TUTORIAL-MIB in the folder c:\usr\share\snmp\mibs

2. i copied nstAgentModuleObject.h nstAgentModuleObject.h into C:\net-snmp-5.5\agent\mibgroup\ folder

3. i added
#include "mibgroup/nstAgentModuleObject.h"
to the file c:\net-snmp-5.5\win32\mib_module_includes.h

and

i added
if (should_init("nstAgentModuleObject")) init_nstAgentModuleObject();

to the file c:\net-snmp-5.5\win32\mib_module_inits.h

4. i compile nstAgentmoduleobject.c into agent.( netsnmpmibssdk project)

The object file nstAgentModuleObject.o is located inthe folder C:\net-snmp-5.5\win32\netsnmpmibssdk\debug\

5. i built snmpdsdk project(net snmp agent).

Next i configured the agent .
snmpd.conf contains the following:
############################################################################
# snmpd.conf

#

# - created by the snmpconf configuration program

#

###########################################################################

# SECTION: Access Control Setup

#

# This section defines who is allowed to talk to your running

# snmp agent.

# rocommunity: a SNMPv1/SNMPv2c read-only access community name

# arguments: community [default|hostname|network/bits] [oid]

rocommunity public localhost

# rwcommunity: a SNMPv1/SNMPv2c read-write access community name

# arguments: community [default|hostname|network/bits] [oid]

rwcommunity private localhost



###########################################################################

# SECTION: System Information Setup

#

# This section defines some of the information reported in

# the "system" mib group in the mibII tree.

# syslocation: The [typically physical] location of the system.

# Note that setting this value here means that when trying to

# perform an snmp SET operation to the sysLocation.0 variable will make

# the agent return the "notWritable" error code. IE, including

# this token in the snmpd.conf file will disable write access to

# the variable.

# arguments: location_string

syslocation COMMUNICATIONS-CRL

# syscontact: The contact information for the administrator

# Note that setting this value here means that when trying to

# perform an snmp SET operation to the sysContact.0 variable will make

# the agent return the "notWritable" error code. IE, including

# this token in the snmpd.conf file will disable write access to

# the variable.

# arguments: contact_string

syscontact "GANESH YELLAPU"





I restarted the agent.

c:\usr\bin\snmptranslate -On -IR nstAgentModuleObject.0

.1.3.6.1.4.1.8072.2.4.1.1.1

C:\usr\bin\snmpget -c public -v 2c localhost nstAgentModuleObject.0

NET-SNMP-TUTORIAL-MIB::nstAgentModuleObject.0 :: No suchobnject available on this agent at this OID

C:\usr\bin\snmpset -c private -v 2c localhost nstAgentModuleObject.0 i 999

Error in packet.

Reason:not writable <that object doesnot support modification>

Failed object: NET-SNMP-TUTORIAL-MIB::nstAgentModuleObject.0

I tried the below command also.

C:\usr\bin\snmptranslate -Dparse NET-SNMP-TUTORIAL-MIB::nstAgentModuleObject

this command showed

parse-mibs:Module NET-SNMP-TUTORIAL-MIB already loaded.

NET-SNMP-TUTORIAL-MIB::nstAgentModuleObject



What is the mistake?

whether snmpd.conf contains correct configur inforamtion?

i have been sending the same mail for one week.

kinldy help and suggest me inthis regard.

Looking forward to the response.


Thank you very much

withregards

Ganesh



















Confidentiality Notice

The information contained in this electronic message and any
attachments to this message are intended for the exclusive use of
the addressee(s) and may contain confidential or privileged
information. If you are not the intended recipient, please notify
the sender at Bharat Electronics or ***@bel.co.in immediately
and destroy all copies of this message and any attachments.
Mike Ayers
2010-02-25 20:44:48 UTC
Permalink
Sent: Sunday, February 21, 2010 7:33 PM
C:\usr\bin\snmptranslate -Dparse NET-SNMP-TUTORIAL-
MIB::nstAgentModuleObject
this command showed
parse-mibs:Module NET-SNMP-TUTORIAL-MIB already loaded.
NET-SNMP-TUTORIAL-MIB::nstAgentModuleObject
Hmmm... are you sure you don't have that MIB module already in the agent? I'd alter the name and move it somewhere under netSnmpExperimental jsut to be sure.

Also, it seems you are looking for an instance of the module - no such thing can exist. Try a get-next on nstAgentModuleObject and see if your object appears.


HTH,

Mike
l***@gmail.com
2015-06-24 10:17:29 UTC
Permalink
Hi. Try to start your agent from build directory. net-snmp-x.x.x/agent.
Loading...