This is a discussion on Error in Packet. ,,Reason: (gen Error) A general Failure occured) within the SNMP Users forums, part of the Networking and Network Related category; --===============0276755949== Content-Type: multipart/alternative; boundary="0-732188372-1176339363=:81007" Content-Transfer-Encoding: 8bit --0-732188372-1176339363=:81007 ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
--===============0276755949==
Content-Type: multipart/alternative; boundary="0-732188372-1176339363=:81007" Content-Transfer-Encoding: 8bit --0-732188372-1176339363=:81007 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit I compiled and ran nstAgentSubagentObject example successfully.Then I added a handler in registration call ( Please see the code below)(a simple subroutine just print a string).I can compile and run my subagent but when I try to run snmpget or snmpset I get the error: Error in Packet. Reason: (gen Error) A general Failure occured) Faild Object: NET-SNMP-TUTORIAL-MIB::nstAgentSubagentObject.0 If I remark that printf and compile it again then I can retrieve/set MIB through snmpget and set. If I add a sum or sub in code it wont work again I really appreciate if somebody can help me. Regards, Reza #include <net-snmp/net-snmp-config.h> #include <net-snmp/net-snmp-includes.h> #include <net-snmp/agent/net-snmp-agent-includes.h> #include "nstAgentSubagentObject.h" / static int nstAgentSubagentObject = 2; / void init_nstAgentSubagentObject(void) { static oid nstAgentSubagentObject_oid[] = { 1, 3, 6, 1, 4, 1, 8072, 2, 4, 1, 1, 2, 0 }; DEBUGMSGTL(("nstAgentSubagentObject", "Initializing the nstAgentSubagentObject module\n")); DEBUGMSGTL(("nstAgentSubagentObject", "Initalizing nstAgentSubagentObject scalar integer. Default value = %d\n", nstAgentSubagentObject)); netsnmp_register_int_instance("nstAgentSubagentObj ect", nstAgentSubagentObject_oid, OID_LENGTH(nstAgentSubagentObject_oid), &nstAgentSubagentObject,Subhandler); DEBUGMSGTL(("nstAgentSubagentObject", "Done initalizing nstAgentSubagentObject module\n")); } int Subhandler(netsnmp_mib_handler *handler,netsnmp_handler_registration *reginfo,netsnmp_agent_request_info *reqinfo,netsnmp_request_info *requests) { int temp,uu,xx; // printf("this is a test \n"); temp=0; uu=0; temp=25; uu=34; xx=123; // xx++; } --------------------------------- Finding fabulous fares is fun. Let Yahoo! FareChase search your favorite travel sites to find flight and hotel bargains. --0-732188372-1176339363=:81007 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit <DIV> </DIV> <DIV>I compiled and ran nstAgentSubagentObject example successfully.Then I added a handler in registration call ( Please see the code below)(a simple subroutine just print a string).I can compile and run my subagent but when I try to run snmpget or snmpset I get the error:</DIV> <DIV><STRONG></STRONG> </DIV> <DIV><STRONG>Error in Packet.</STRONG></DIV> <DIV><STRONG>Reason: (gen Error) A general Failure occured)</STRONG></DIV> <DIV><STRONG>Faild Object: NET-SNMP-TUTORIAL-MIB::nstAgentSubagentObject.0</STRONG></DIV> <DIV> </DIV> <DIV>If I remark that printf and compile it again then I can retrieve/set MIB through snmpget and set. </DIV> <DIV>If I add a sum or sub in code it wont work again</DIV> <DIV> </DIV> <DIV>I really appreciate if somebody can help me.</DIV> <DIV> </DIV> <DIV>Regards,</DIV> <DIV>Reza</DIV> <DIV> </DIV> <DIV> </DIV><FONT color=#0000ff size=2> <DIV>#include</FONT><FONT size=2> <net-snmp/net-snmp-config.h></DIV></FONT><FONT color=#0000ff size=2> <DIV>#include</FONT><FONT size=2> <net-snmp/net-snmp-includes.h></DIV></FONT><FONT color=#0000ff size=2> <DIV>#include</FONT><FONT size=2> <net-snmp/agent/net-snmp-agent-includes.h></DIV></FONT><FONT color=#0000ff size=2> <DIV>#include</FONT><FONT size=2> "nstAgentSubagentObject.h"</DIV> <DIV> </DIV> <DIV>/</DIV></FONT><FONT color=#0000ff size=2> <DIV>static</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> nstAgentSubagentObject = 2;</DIV> <DIV>/</DIV></FONT><FONT color=#0000ff size=2> <DIV>void</DIV></FONT><FONT size=2> <DIV>init_nstAgentSubagentObject(</FONT><FONT color=#0000ff size=2>void</FONT><FONT size=2>)</DIV> <DIV>{</DIV> <DIV></FONT><FONT color=#0000ff size=2>static</FONT><FONT size=2> oid nstAgentSubagentObject_oid[] =</DIV> <DIV>{ 1, 3, 6, 1, 4, 1, 8072, 2, 4, 1, 1, 2, 0 };</DIV> <DIV>DEBUGMSGTL(("nstAgentSubagentObject",</DIV> <DIV>"Initializing the nstAgentSubagentObject module\n"));</DIV> <DIV> </DIV> <DIV></DIV> <DIV>DEBUGMSGTL(("nstAgentSubagentObject",</DIV> <DIV>"Initalizing nstAgentSubagentObject scalar integer. Default value = %d\n",</DIV> <DIV>nstAgentSubagentObject));</DIV> <DIV>netsnmp_register_int_instance("nstAgentSubage ntObject",</DIV> <DIV>nstAgentSubagentObject_oid,</DIV> <DIV>OID_LENGTH(nstAgentSubagentObject_oid),</DIV> <DIV>&nstAgentSubagentObject,<STRONG>Subhandle r</STRONG>);</DIV> <DIV> </DIV> <DIV>DEBUGMSGTL(("nstAgentSubagentObject",</DIV> <DIV>"Done initalizing nstAgentSubagentObject module\n"));</DIV> <DIV>}</DIV> <DIV> </DIV></FONT><FONT color=#0000ff size=2> <DIV>int</FONT><FONT size=2> <STRONG>Subhandler</STRONG>(netsnmp_mib_handler *handler,netsnmp_handler_registration *reginfo,netsnmp_agent_request_info *reqinfo,netsnmp_request_info *requests)</DIV> <DIV>{</DIV> <DIV></FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> temp,uu,xx; </DIV> <DIV></FONT><FONT color=#008000 size=2>// printf("this is a test \n");</DIV></FONT><FONT size=2> <DIV>temp=0;</DIV> <DIV>uu=0; </DIV> <DIV>temp=25;</DIV> <DIV>uu=34;</DIV> <DIV>xx=123;</DIV> <DIV></FONT><FONT color=#008000 size=2>// xx++;</DIV> <DIV> </DIV> <DIV> </DIV></FONT><FONT size=2> <DIV>}</DIV></FONT><p> <hr size=1>Finding fabulous fares is fun.<br><a href="http://farechase.yahoo.com/promo-generic-14795097;_ylc=X3oDMTFtNW45amVpBF9TAzk3NDA3NTg5BF9z AzI3MTk0ODEEcG9zAzEEc2VjA21haWx0YWdsaW5lBHNsawNxMS 0wNw-- ">Let Yahoo! FareChase search your favorite travel sites</a> to find flight and hotel bargains. --0-732188372-1176339363=:81007-- --===============0276755949== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?p...rge&CID=DEVDEV --===============0276755949== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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/...net-snmp-users --===============0276755949==-- |