Hi,
When the do snmpget/walk for the ifTable for the original net-snmp agent
(snmpd). I'm getting the o/p as below. Whereas when i do snmpwalk/get for my
own generated code ( using mib2c for ifTable), but the o/p is different.
>From my code, the mib is displyes as (IF-MIB::ifTable.2.1.7.1 = INTEGER: 1)
where in from the net-snmp orginal agent (snmpd) the mib is diplayed as (
IF-MIB::ifAdminStatus.1 = INTEGER: up(1)).
Please answer the following:
1) do I need something more to display the mib as IF-MIB::ifAdminStatus instead
of IF-MIB::ifTable.2.1.7 ?
2) How can I get the value as up(1) instead of just 1 ?
o/p Using original net-snmp agent:
-----------------------------
....
...
IF-MIB::ifAdminStatus.1 = INTEGER: up(1)
IF-MIB::ifAdminStatus.2 = INTEGER: down(2)
o/p Using my own code (generated by mib2c with ifTable):
----------------------------------------------------
IF-MIB::ifTable.2.1.7.1 = INTEGER: 1
<<<<<<Here IF-MIB::ifTable.2.1.7.1 is displayed instead of
IF-MIB::ifAdminStatus.1
My code snapshot is:
--------------------
....
{IFADMINSTATUS, ASN_INTEGER, RWRITE, var_ifEntry, 3, {2, 1, 7}},
.....
u_char *
var_ifEntry(struct variable *vp,
oid * name,
size_t * length,
int exact, size_t * var_len, WriteMethod ** write_method)
{
.....
.....
case IFADMINSTATUS:
long_return = if_msg.ifm_flags & IFF_UP ? 1 : 2;
return (u_char *) & long_return;
I have found the same code snapshot even in the net-snmp interface.c file.
Thanks in advace.
Regards,
Narasi.
Connect with friends all over the world. Get Yahoo! India Messenger at
http://in.messenger.yahoo.com/?wm=n/
------------------------------------------------------------------------------
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-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders