Re: Doing things in a callback routine

Thomas Andrews <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
Dave Shield wrote:
> On 30 March 2010 15:30, Thomas Andrews <[email protected]> wrote:
>> I can now get my_string using a GET but I get this warning when I do so:
>>
>>   NET-SNMP-EXAMPLES-MIB::netSnmpExampleString = Wrong Type (should be
>>   INTEGER): STRING: "bla bla bla"
>>
>> What am I doing wrong here? Does netsnmp_register_watched_scalar() only
>> work with INTEGERs ??
> 
> No - it works with any type of MIB object.
> 
> If you look closely at the error message, you'll see that the agent
> *is* returning a string value, but the client (snmpget) is expecting
> an INTEGER.   Though I don't know why!
> 
> In fact, the correct response to the GET request you're giving
> should actually be "noSuchName" (v1) or "noSuchInstance (v2).
> I'm not sure why it's returning a value instead.

It's actually a bug in /usr/share/snmp/mibs/NET-SNMP-EXAMPLES-MIB.txt !

This is what it is:

netSnmpExampleString OBJECT-TYPE
     SYNTAX      Integer32
     MAX-ACCESS  read-write
     STATUS      current

But it should actually be:

netSnmpExampleString OBJECT-TYPE
     SYNTAX      SnmpAdminString
     MAX-ACCESS  read-write
     STATUS      current

If I fix it the problem goes away.

Thanks for all your help!
Thomas

------------------------------------------------------------------------------
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
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.