[Fwd: SNMPGET...[NET-SNMP-TUTORIAL-MIB::nstAgentModuleObject]]

[email protected]
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
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.obj 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>snmpget -c public -v 1 localhost nstAgentModuleObject.0

Sending 46 bytes to UDP: [127.0.0.1]:161->[0.0.0.0]
0000: 30 2C 02 01  00 04 06 70  75 62 6C 69  63 A0 1F 02    0,.....public ..
0016: 02 74 21 02  01 00 02 01  00 30 13 30  11 06 0D 2B    .t!......0.0...+
0032: 06 01 04 01  BF 08 02 04  01 01 01 00  05 00          ....?.........


Received 46 bytes from UDP: [127.0.0.1]:161->[0.0.0.0]
0000: 30 2C 02 01  00 04 06 70  75 62 6C 69  63 A2 1F 02    0,.....public"..
0016: 02 74 21 02  01 02 02 01  01 30 13 30  11 06 0D 2B    .t!......0.0...+
0032: 06 01 04 01  BF 08 02 04  01 01 01 00  05 00          ....?.........

Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: NET-SNMP-TUTORIAL-MIB::nstAgentModuleObject.0


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.

Please find attachmetns (snmpd.conf, snmp.conf)

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 [email protected] immediately
and destroy all copies of this message and any attachments.

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev

_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
snmp.conf (application/octet-stream, 2.3 KB)
###########################################################################
#
# snmp.conf
#
#   - created by the snmpconf configuration program
#
###########################################################################
# SECTION: Default Authentication Options
#
#   This section defines the default authentication
#   information.  Setting these up properly in your
#   ~/.snmp/snmp.conf file will greatly reduce the amount of
#   command line arguments you need to type (especially for snmpv3).

# defversion: The default snmp version number to use.
#   override: with -v on the command line.
#   arguments: 1|2c|3

defversion  2c

# defcommunity: The default snmpv1 and snmpv2c community name to use when needed.
#   If this is specified, you don't need to include the community
#   name as an argument to the snmp applications.  
#   override: with -c on the command line.
#   arguments: communityname

defcommunity  public



###########################################################################
# SECTION: Debugging output options
#
#   This section allows debugging output of various kinds to
#   be turned on or off.

# dodebugging: Turns debugging output on or off (0|1)
#   arguments: (0|1)

dodebugging  0

# debugtokens: Debugging tokens specify which lines of debugging
#   output you'd actually like to see.  Each section of code is most
#   likely instrumented with a particular "tag".  So, to see that tag you
#   would specify it here.  Specifying a tag will match against all
#   tags that begin with that prefix, so the tag "test" will match
#   "test_function" and "test_something" and...
#   There are a few special tokens as well:
#   - ALL:   turns on all the tokens (which generates lots of output)
#   - trace: prints 'trace' lines showing source code files and
#   -        line numbers as they're traversed.
#   - dump:  Nicely breaks down packets as they're parsed or sent out.
#   command line equivelent: -Dtoken[,token...]
#   arguments: token[,token...]

#debugtokens  

# dumppacket: Print packets as they are received or sent
#   arguments: (1|yes|true|0|no|false)
#   command line equivelent: -d

dumppacket  1

# notokenwarnings: Silence warnings about unknown tokens in configuration files
#   arguments: (1|yes|true|0|no|false)

notokenwarnings  1
snmp.conf (application/octet-stream, 2.3 KB)
###########################################################################
#
# snmp.conf
#
#   - created by the snmpconf configuration program
#
###########################################################################
# SECTION: Default Authentication Options
#
#   This section defines the default authentication
#   information.  Setting these up properly in your
#   ~/.snmp/snmp.conf file will greatly reduce the amount of
#   command line arguments you need to type (especially for snmpv3).

# defversion: The default snmp version number to use.
#   override: with -v on the command line.
#   arguments: 1|2c|3

defversion  2c

# defcommunity: The default snmpv1 and snmpv2c community name to use when needed.
#   If this is specified, you don't need to include the community
#   name as an argument to the snmp applications.  
#   override: with -c on the command line.
#   arguments: communityname

defcommunity  public



###########################################################################
# SECTION: Debugging output options
#
#   This section allows debugging output of various kinds to
#   be turned on or off.

# dodebugging: Turns debugging output on or off (0|1)
#   arguments: (0|1)

dodebugging  0

# debugtokens: Debugging tokens specify which lines of debugging
#   output you'd actually like to see.  Each section of code is most
#   likely instrumented with a particular "tag".  So, to see that tag you
#   would specify it here.  Specifying a tag will match against all
#   tags that begin with that prefix, so the tag "test" will match
#   "test_function" and "test_something" and...
#   There are a few special tokens as well:
#   - ALL:   turns on all the tokens (which generates lots of output)
#   - trace: prints 'trace' lines showing source code files and
#   -        line numbers as they're traversed.
#   - dump:  Nicely breaks down packets as they're parsed or sent out.
#   command line equivelent: -Dtoken[,token...]
#   arguments: token[,token...]

#debugtokens  

# dumppacket: Print packets as they are received or sent
#   arguments: (1|yes|true|0|no|false)
#   command line equivelent: -d

dumppacket  1

# notokenwarnings: Silence warnings about unknown tokens in configuration files
#   arguments: (1|yes|true|0|no|false)

notokenwarnings  1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.