After reading the FAQs, I know I am not supposed to use the same community string for both rwcommunity and rocommunity. But it doesn't help me to get rid of the noSuchName error.
Another strange thing is, the return value from snmpget localhost netSnmpExampleInteger.0 (from scalar_int.c sample) is also noSuchName error. I can however get values like sysUpTime.0 without any problem. Am I missing some steps when adding my own module or something? What I did was: Moved MY-MIB to /usr/local/share/snmp/mibs export MIBS=+MY-MIB created myMib.h and myMib.c files in ./agent/mibgroups/ configure --with-mib-modules="myMib" make make install added access control entries in /usr/local/share/snmp/snmpd.conf for snmpv1/2 started snmpd ran snmpget -v1 -c public localhost ... Thanks for any advices. /Pan ---------------------------- Original Message ---------------------------- Subject: Re: Q: how to create a simple agent deals with scalars From: "Xuan Pan" <[EMAIL PROTECTED]> Date: Thu, December 20, 2007 13:07 To: "Dave Shield" <[EMAIL PROTECTED]> Cc: [email protected] -------------------------------------------------------------------------- Thanks for your answers. I only have rocommunity public and rwcommunity public in my snmpd.conf file. There are no other access control settings. Could this be a problem? My initScalar(void) is simply a copy of the example code, init_scalar_int which has a static variable and an oid instance defined. Then I call netsnmp_register_int_instance with a NULL sub-handler function. Practically, I don't think this implementation should work either. Because 1. I see no reason my initScalar() can get called by the snmpd daemon. I mean the method initScalar() has no references. 2. I thought I should write something in my initScalar() to switch from one request mode to another in order to handle different requests (set/get/get next...) and I didn't then how could snmpd tell which operation it should execute when it receives a corresponding request? /Pan > On 20/12/2007, Xuan Pan <[EMAIL PROTECTED]> wrote: >> I wrote an extension agent that deals with a single integer object >> defined >> in my MIB file by referencing the sample of scalar_int.c >> (http://www.net-snmp.org/dev/agent/scalar__int_8c-example.html) >> >> The problem is I keep getting the error, "(noSuchName) There is no such >> variable name in the MIB" when getting the value from this variable or >> setting the value for it. The fact is the variable does exist in the MIB >> file and I have assigned the read-write access right to it. Can anyone >> tell me the reason for this? > > There are two likely causes: > > a) The registration of this module doesn't use the OID(s) that you > expect. > b) The access control settings of the agent don't allow access to this > OID. > > Can you see other MIB objects in the general vicinity of your scalar? > That would tend to show whether the access control is correct or not. > > For the first option, we'd probably need to see the init_xxx() routine > from your module, together with the exact command(s) that you are > using to query the agent. > > Dave > ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ 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
