hi ... i tried using the watcher handler u mentioned. but now the problem is as follows:
i have declared my mib variable (netsnmpfilename) as an octet string. when i do an snmptranslate: -------------------------------- snmptranslate -mALL -M /usr/local/net-snmp-5.1.1/mibs/ -On -IR -Tp netSnmpfilename +-- -RW- String netSnmpfilename(2) Size: 1..32 snmptranslate -mALL -M /usr/local/net-snmp-5.1.1/mibs/ -On -IR netSnmpfilename .1.3.6.1.4.1.8072.2.5.2 Now when i do a set on my variable: -------------------------------------- snmpset -v 2c -c public localhost .1.3.6.1.4.1.8072.2.5.2.0 s "File1" NET-SNMP-EXAMPLES-MIB::netSnmpExamples.5.2.0 = STRING: "File1" Now when i do a get on my variable: -------------------------------------- snmpget -v 2c -c public localhost .1.3.6.1.4.1.8072.2.5.2.0 NET-SNMP-EXAMPLES-MIB::netSnmpExamples.5.2.0 = Hex-STRING: 00 00 00 00 00 i am getting a hex-string output when i do a get whereas my set says it is a string variable. the init_netsnmpfilename () code i have written is as follows: ------------------ void init_netsnmpfilename(void) { char str_buffer[33]; static oid netSnmpfilename_oid[] = { 1, 3, 6, 1, 4, 1, 8072, 2, 5, 2 }; DEBUGMSGTL(("netSnmpfilename", "Initializing\n")); netsnmp_register_watched_scalar( netsnmp_create_handler_registration( "netSnmpfilename", NULL, netSnmpfilename_oid, OID_LENGTH(netSnmpfilename_oid), HANDLER_CAN_RWRITE), netsnmp_create_watcher_info( &str_buffer, sizeof(str_buffer), ASN_OCTET_STR, WATCHER_MAX_SIZE) ); } ----------------- please help out and tell me where i have goofed up. regards, sharath --- Robert Story <[EMAIL PROTECTED]> wrote: > On Thu, 30 Dec 2004 04:57:30 -0800 (PST) sharath > wrote: > SR> Reason: resourceUnavailable (This is likely a > SR> out-of-memory failure within the agent) > SR> > SR> Can anyone please tell me where i have gone > wrong??? > SR> also to the best of my knowledge, unlike for > scalar > SR> inetgers, there are no pre-written handlers for > string > SR> scalars. in case there are any please let me > know > SR> where i can find them. > > Dave has a 'watcher' handler that can work for > strings... Check out > include/net-snmp/agent/watcher.h. > > If that doesn't work, or you want to try and get > yours to work, let me know. > > -- > Robert Story; NET-SNMP Junkie > Support: <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. > __________________________________ Do you Yahoo!? Read only the mail you want - Yahoo! Mail SpamGuard. http://promotions.yahoo.com/new_mail ------------------------------------------------------- The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt _______________________________________________ Net-snmp-users mailing list Net-snmp-users@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users