Re: HOW to use snmpset to set value of a COUNTER64 type OID parameter

lucky goyal <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
Hi Marc,

Thanks for your reply. You are right. I had implemented MY-MIB as subagent using 'mib2c' code generation tool. The problem was in the function 'netsnmp_check_vb_type_and_size()' which is called in subagent code . When the 'U' is used to represent the set variable type (snmpset -v2c -cpublic localhost MY-MIB::Variable.1 U 1234 ) the variable type sent in the SNMP SET request is ASN_OPAQUE, whereas the variable type for COUNTER64 is ASN_COUNTER64. This results in mismatch of type as mentioned by you and the SET operation fails. A work around for this is to compare the incoming variable type with ASN_OPAQUE rather than ASN_COUNTER64, which is what you suggested. I am able to SET the COUNTER64 type OID parameter using this work around(thanks to your reply). But I am wondering if there is a way where the variable type in the incoming request itself is ASN_COUNTER64 and not ASN_OPAQUE? Please let me know if you know one.

Thanks and Regards,
Lucky Goyal




________________________________
From: "Arazo Camprecios, Marc" <[email protected]>
To: lucky goyal <[email protected]>; [email protected]
Sent: Tuesday, November 4, 2008 5:42:28 PM
Subject: RE: HOW to use snmpset to set value of a COUNTER64 type OID parameter


Hello,
 
I had the same problem. It seems that when using an Unisgned value in a table the default function which checks the variable type doesn’t work properly.
 
Try using this one:
 
ret = netsnmp_check_vb_type(requests->requestvb, ASN_UNSIGNED);
 
-----------------
Marc Arazo
 

________________________________

De:lucky goyal [mailto:[email protected]] 
Enviado el: martes, 04 de noviembre de 2008 12:05
Para: [email protected]
Asunto: HOW to use snmpset to set value of a COUNTER64 type OID parameter
 
Hi ALL,

I want to set a OID parameter which is of type "COUNTER64" using 'snmpset'. The parameter has MAX-ACCESS read-write and is member of a Table. I am trying following command

 snmpset -v2c -cpublic localhost MY-MIB::Variable.1 U 1234

But agent sends back a response with error status as  WRONG_TYPE(7). 

Could anyone please tell how to set value of this COUNTER64 variable.

Thanks and Regards,
Lucky

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

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