SNMPGET returning wrong value for the OID.
jack n <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
Hi all,
Please check on the MIB file and corresponding .c file generated by MIB2C -
and the SNMPGET run for that MIB.
*My MIB File Contains :*
aa OBJECT IDENTIFIER ::= { enterprises 1429 }
aaModules OBJECT IDENTIFIER ::= { aa 79 }
xxCmg MODULE-IDENTITY
LAST-UPDATED "201007210000Z"
ORGANIZATION "xx"
CONTACT-INFO "xx"
DESCRIPTION
"Controls the behavior of the Modem"
REVISION "201007210000Z"
::= { xyz 5 }
*xxCmgDevice OBJECT-TYPE
SYNTAX INTEGER {
disable(0),
enable(1)
}*
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Control Gateway.
If disable(0), will not send out DHCP DISCOVER message.
If DHCP option 122.1 is missing, is disabled and MIB is set to
disable(0)."
::= { abc 1 }
*The .c file generated for it is :*
int
handle_xxCmgDevice(netsnmp_mib_handler *handler,
netsnmp_handler_registration *reginfo,
netsnmp_agent_request_info *reqinfo,
netsnmp_request_info *requests)
{
/*
* We are never called for a GETNEXT if it's registered as a
* "instance", as it's "magically" handled for us.
*/
/*
* a instance handler also only hands us one request at a time, so
* we don't need to loop over a list of requests; we'll only get one.
*/
* int gDevice_booValue;
gDevice_booValue = 1;
switch (reqinfo->mode) {
case MODE_GET:
snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,(u_char *)
&gDevice_booValue, sizeof(int));
break;
*
default:
/*
* we should never get here, so this is a really bad error
*/
snmp_log(LOG_ERR, "unknown mode (%d) in handle_xxCmgDevice\n",
reqinfo->mode);
return SNMP_ERR_GENERR;
}
return SNMP_ERR_NOERROR;
}
When I do a SNMPGET on cscoCmEmgDevice.0
*[root@satsukum-lnx mibs]# snmpget -v 1 -c public localhost xxCmgDevice.0*
*No log handling enabled - using stderr logging
Expected DESCRIPTION (:): At line 38 in
/usr/local/share/snmp/mibs/CSCO-CM-EMG.mib.txt
XG-MIB::xxCmgDevice.0 = INTEGER: disable(0)*
PLease let me know, why it is not returning a value "1" as assigned
for "*gDevice_booValue = 1;" in the .c file and returning - INTEGER:
disable(0) ?
Please let me know if I am doing something wrong.
Regards,
Jack.
*
------------------------------------------------------------------------------
This SF.net email is sponsored by
Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-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