Re: Q: how to create a simple agent deals with scalars

"Xuan Pan" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[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
>



-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
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
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.