Opaque types
"Violette Moulin" <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
Hi all,
Please excuse me for my bad english, I hope you'll understand my problem.
I've set an Opaque type (float) in my MIB. In my subagent C file, I wrote :
static float myFloat;
...
int SnmpEagleSubagent::handleInstance(...)
{
switch (reqinfo->mode)
{
case MODE_GET:
snmp_set_var_typed_value(
requests->requestvb,
ASN_OPAQUE_FLOAT,
(u_char *) &(myFloat),
sizeof(myFloat));
break;
...
case MODE_SET_ACTION:
myFloat = atof(netsnmp_strdup_and_null(requests->requestvb->
val.string, requests->requestvb->val_len));
break;
...
}
}
...
Then I have a problem as I try to set a value with snmpset :
$ snmpset -v 1 -c private localhost myFloat.0 s 2.5
myFloat.0: Bad variable type (Type of attribute is Opaque, not OCTET STRING)
$ snmpset -v 1 -c private localhost myFloat.0 p 2.5
myFloat.0: Bad object type: p
In the snmpset man page, there isn't type value for Opaque....
Is it impossible to set an Opaque value with snmpset?
Is there other solution?
Thank you for your help,
Violette
-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
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