Re: snmpset gives an gen Error message

Leo Lin <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
Hi Jack;
 
The error was in the handler I implemented.  I comitted a silly mistake of deleting the modes I did not have code for, for example:
 
int syslocation_handler(netsnmp_mib_handler *handler,
                                  netsnmp_handler_registration *reginfo,
                                  netsnmp_agent_request_info *reqinfo,
                                  netsnmp_request_info *requests) {
 
     switch (reqinfo->mode) {
          case MODE_GET:
              // my code here
              break;
          case MODE_SET_ACTION:
             // my code here
              break;
          default:
              return SNMP_ERR_GENERR;
     }
     return SNMP_ERR_NOERROR;
}
 
as you see, I'm missing MODE_SET_RESERVE1, MODE_SET_RESERVE2, MODE_SET_UNDO, MODE_SET_COMMIT, and MODE_SET_FREE, so in such instances, the routine returns SNMP_ERR_GENERR.
 
if you do a snmpget, it will not create this error, as it does not go through the several SET modes as in snmpset.
 
Hope it helps,
 
Leo;

--- On Mon, 11/29/10, jack n <[email protected]> wrote:


From: jack n <[email protected]>
Subject: Re: snmpset gives an gen Error message
To: "Leo Lin" <[email protected]>
Cc: "Net-snmp-users" <[email protected]>
Date: Monday, November 29, 2010, 12:08 AM



Hi Leo,
 
I am facing a similar issue, can  you please tell me how u debugged this issue??
 
Thanks and Regards,
Jack.


On Sun, Oct 17, 2010 at 8:22 AM, Leo Lin <[email protected]> wrote:






I've found the bug, now it's working fine.
 
Thanks!
 
Leo;

--- On Sat, 10/16/10, Leo Lin <[email protected]> wrote:


From: Leo Lin <[email protected]>
Subject: snmpset gives an gen Error message
To: "Net-snmp-users" <[email protected]>
Date: Saturday, October 16, 2010, 2:38 PM 











Hi,
 
I've been extending the snmpd with my own modules.  I made sure that each module is working properly before adding another one.
 
Suddendly, on one of the latest modules, netsnmp builds ok, but I get an error while using snmpset command.
 
I also tested the snmpset with a library in c# separate from netsnmp, and it does not work either.
 
I removed the module, and re-build the netsnmp and still gives me the error.
 
The error is:
 
$snmpset -v1 -cprivate localhost myvar.0 i 0
Error in packet.
Reason: (genError) A general failure occured
 
it happens with each oid I've implemented.  I'm using net-snmp-5.6.rc1.
 
I also though that maybe the modules that I've extended created some seg-fault, and overwrite some source/header files in net-snmp, so I re-install (tar) the whole netsnmp, but I still get the error.
 
I'm not too sure what could cause this sudden error.  I reverted to only the modules that was working fine before, and I did not change the MIB or the snmpd.conf files.
 
Thanks!
 
Leo;


------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
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

------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev

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