SET request

Tanisha Kashyap <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <08A2197FCF31F642988F149222F8B88D85379D@GUREXMB01.ASIAN.AD.ARICENT.COM>
Hi,

I have written a small piece of agent code in perl to implement GET and SET.
The Get and Set work fine when I do snmpget/set from the CLI. However when I do the Set from an NMS installed on another machine, I get a function timed out error.
On running the snoop command I found that the packets are being sent from the NMS and there is no response from my agent.
I guess I have not implemented the SET functionality properly.

elsif ($request_info->getMode() == MODE_SET_RESERVE1) {
                  if ($oid != new NetSNMP::OID(".1.3.6.1.4.1.323.5.3.3.1.1.1.0")) {
                       print STDERR "\nMode: SET_RESERVE1";
                        #... do error checking here
               $request->setError($request_info, SNMP_ERR_NOSUCHNAME);
                   }
               }
                 elsif ($request_info->getMode() == MODE_SET_ACTION) {
                        print STDERR "\nMode: SET_ACTION";
                        if ($oid == new NetSNMP::OID(".1.3.6.1.4.1.323.5.3.3.1.1.1.0")){
                        $value = $request->getValue();
                        print STDERR "\nSet Value = $value";
                        $oid_hash{"1.3.6.1.4.1.323.5.3.3.1.1.1.0"} = $value;
                        lock_store(\%oid_hash,'/usr/local/share/snmp/testfile.txt');
                        }

"If you think you can, or you think you can't...You are Right"   -- Henry Ford


________________________________
"DISCLAIMER: This message is proprietary to Aricent and is intended solely for the use of the individual to whom it is addressed. It may contain privileged or confidential information and should not be circulated or used for any purpose other than for what it is intended. If you have received this message in error,please notify the originator immediately. If you are not the intended recipient, you are notified that you are strictly prohibited from using, copying, altering, or disclosing the contents of this message. Aricent accepts no responsibility for loss or damage arising from the use of the information transmitted by this email including damage from virus."

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H

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