Hi,

I am trying to test my agent using the SNMPc v5.1 NMS. The Get request works 
fine. However the Set gives a timeout error.

Agent: Get and Set blocks
######################################################################################################
 #
if ($request_info->getMode() == MODE_GET) {
                    # ... generally, you would calculate value from oid
                    if ($oid == new 
NetSNMP::OID(".1.3.6.1.4.1.323.5.3.3.1.1.1.0")){
                        $oidHash = 
lock_retrieve('/usr/local/share/snmp/testfile.txt');
                        print $oidHash{"1.3.6.1.4.1.323.5.3.3.1.1.1.0"};
                        $request->setValue(ASN_INTEGER, 
$oidHash->{"1.3.6.1.4.1.323.5.3.3.1.1.1.0"});
                        }


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")) {
                        #... do error checking here
                       $request->setError($request_info, SNMP_ERR_NOSUCHNAME);
                   }
                } elsif ($request_info->getMode() == MODE_SET_ACTION) {
                        $value = $request->getValue();
                        $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
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

Reply via email to