On Fri, Mar 21, 2014 at 12:37:16PM -0700, linda zhu wrote:
> Hi,
> 
> I tried to run the examples given for "Compiling in your new MIB module". I 
> followed the instruction, copied nstAgentComduleObject.c and 
> nstAgentModuleObject.h to agent/mibgroup, and run the command:
>  ./configure --with-mib-modules="nstAgentModuleObject"
> Then, did "make" and "make install".
> 
> My snmpd.conf is in /usr/local/share/snmp, its contents are as follows:
> # 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
> rocommunity tutget .1.3.6.1.4.1.8072.2.4
> rwcommunity tutset .1.3.6.1.4.1.8072.2.4
> 
> 
> However, when I tried to start snmpd, I got the error as this:
> 
>  /usr/local/sbin/snmpd -f -Lo -d -p 9999
> getaddrinfo: .1.3.6.1.4.1.8072.2.4 Name or service not known
> /usr/local/share/snmp/snmpd.conf: line 26: Error: cannot resolve source 
> hostname
> getaddrinfo: .1.3.6.1.4.1.8072.2.4 Name or service not known
> /usr/local/share/snmp/snmpd.conf: line 27: Error: cannot resolve source 
> hostname
> net-snmp: 2 error(s) in config file(s)

This is like the program says, your config file is wrong.
The documentation (man snmpd.def) for rocommunity and rwcommunity says:

       rocommunity COMMUNITY [SOURCE [OID | -V VIEW [CONTEXT]]]
       rwcommunity COMMUNITY [SOURCE [OID | -V VIEW [CONTEXT]]]
              specify an SNMPv1 or SNMPv2c  community  that  will  be  allowed
              read-only (GET and GETNEXT) or read-write (GET, GETNEXT and SET)
              access respectively.  By default, this will  provide  access  to
              the  full  OID  tree for such requests, regardless of where they
              were sent from. The SOURCE token can be used to restrict  access
              to  requests  from the specified system(s) - see com2sec for the
              full details.  The OID field restricts access for that community
              to the subtree rooted at the given OID, or named view.  Contexts
              are typically less relevant to  community-based  SNMP  versions,
              but the same behaviour applies here.

and from this one can see that you need to add a source before the OID in your
configuration file.

/MF

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to