Hello,
My following code is not working as I want to get the description of a
node using the Net-Snmp library.
|#include "net-snmp/net-snmp-config.h"
#include "net-snmp/net-snmp-includes.h"
void print_s(struct tree*);
int main(int argc, char ** argv)
{
char buff[100];
struct tree*node=NULL;
init_mib();
node=read_all_mibs();
if( node== NULL)
{
exit(2);
}
print_s(node);
}
void print_s(struct tree*tree)
{
struct tree*tp;
for (tp= tree->child_list; tp; tp= tp->next_peer)
{
printf("%s:%s\n",tp->label,tp->description);
}
for (tp= tree->child_list; tp; tp= tp->next_peer)
{
if (tp->child_list)
print_s(tp);
}
}
o/p-
org:(null)
dod:(null)
internet:(null)
snmpV2:(null)
security:(null)
private:(null)
experimental:(null)
mgmt:(null)
directory:(null)
snmpModules:(null)
snmpProxys:(null)
snmpDomains:(null)
snmpMIB:(null)
snmpFrameworkMIB:(null)
.........
........|
I am getting the null for all the nodes,
Kindly tell me why I am not able to get the description of nodes as it
is available .when I am using the command line option as follow
|snmptranslate-On -Td 1.3.6.1.6.3.10
Result
-----------
.1.3.6.1.6.3.10
snmpFrameworkMIB MODULE-IDENTITY
-- FROM SNMP-FRAMEWORK-MIB
DESCRIPTION"The SNMPManagement Architecture MIB
Copyright (C) The Internet Society (2002). This
version ofthis MIB module is part of RFC3411;
see the RFC itselffor full legal notices.
"
::= { iso(1) org(3) dod(6) internet(1) snmpV2(6) snmpModules(3) 10 }|
|1.3.6.1.6.3.10| is the |oid| of the |snmpFrameworkMIB| but you can see
above the node in my program got null as its |description|.
Can any one know what is the problem here.
Thanks
Pradipta
------------------------------------------------------------------------------
Keep yourself connected to Go Parallel:
BUILD Helping you discover the best ways to construct your parallel projects.
http://goparallel.sourceforge.net
_______________________________________________
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