Hello,
I've been trying to compile an agent (in win32, using VC++ 6.0) I have extended to some test mib I have designed. I have executed the mib2c and generated the 2 files and added them to the project and succesfully built snmpd. Then I unload the service, replace the snmpd.exe file and upload the service once again. I do some standard snmpget to system variables and they work fine, but when I try to do it with the extended part I have made, I get this message: TEST::avDescr.0 = no such object available on this agent at this OID, I try using this command: snmpget -m ALL -v 2c -c public localhost .1.3.6.1.4.1.1.1.1.0 This also happens when using the NET-SNMP-TUTORIAL-MIB.
I don't know if I'm doing something wrong in the compiling process or in modifying the code for the mib. I'm not sure what to fill in this part, I did this as a test. Part of the code is (I don't know if I'm doing it alright):
int handle_avDescr(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *reqinfo, netsnmp_request_info *requests) { /* We are never called for a GETNEXT if it's registered as a "instance", as it's "magically" handled for us. */
/* a instance handler also only hands us one request at a time, so we don't need to loop over a list of requests; we'll only get one. */
u_char * test="avDescr test";
switch(reqinfo->mode) {
case MODE_GET:
snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR,
(u_char *)& test/* XXX: a pointer to the scalar's data */,
strlen(test)/* XXX: the length of the data in bytes */);
break;
default: /* we should never get here, so this is a really bad error */ return SNMP_ERR_GENERR; }
return SNMP_ERR_NOERROR; }
Thanks a lot.
_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus
------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ Net-snmp-coders mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders