On Fri, 28 May 2004 16:00:44 +0100 Dave wrote:
DS> Have a look at "netsnmp_register_watched_scalar"
DS> Not only does this cope with string values as well as integer ones,
DS> it also handles scalar objects correctly (which netsnmp_register_instance
DS> doesn't - in particular requests for an invalid instance)

If I'm not mistaken, it does have a quirk or two related to strings. I can't
remember exactly, but I want to say that it doesn't handle variable length
strings very well.


DS> I'm afraid there aren't any examples using it (yet!),
DS> but it'd be something like:

I've seen you post this before, so I assume you have a template. Can you update
your template, and add one line:

         static char myStringObject[128];

DS>      netsnmp_handler_registration *reg =
DS>          netsnmp_create_handler_registration(
DS>                 "myStringObject", NULL,
DS>                 myStringObjectOID, OID_LENGTH(myStringObjectOID),
DS>                 HANDLER_CAN_RONLY);
DS>      netsnmp_watcher_info *winfo =
DS>          netsnmp_create_watcher_info(
DS>                 myStringObject, strlen(myStringObject),
DS>                 ASN_OCTET_STR, WATCHER_FIXED_SIZE);
DS>      netsnmp_register_watched_scalar( reg, winfo );


I've had at least two people wander through the irc channel using this example
code with a local variable!

-- 
Robert Story; NET-SNMP Junkie <http://www.net-snmp.org/>
<irc://irc.freenode.net/#net-snmp>  
Archive: <http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-users>

You are lost in a twisty maze of little standards, all different. 


-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
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

Reply via email to