Need help loading and traversing MIBs

"Odiee47 ." <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <CAF3dL5FsOtiDrB+zZtWX3=2SzOzmW33_fjGsFmV_UW+Y6ZOhPQ@mail.gmail.com>
Hi,

I am trying to build an agent that could load specified MIBs and then query
selected values. But when I try to print mib information via "print_mib" my
application crashes. I'm using this code to load MIB

 netsnmp_init_mib();
 read_all_mibs();
 snmp_set_mib_warnings(2);
 //struct tree *tr = netsnmp_read_module("CISCO-RHINO-MIB");
 struct tree *tr = read_mib("CISCO-RHINO-MIB.mib");

 //
 while(tr)
      {
       printf("%s\n",tr->label);
       tr = tr->next_peer;
      }

 FILE *f = fopen("test.txt","w");
 print_mib(f);
 fclose(f);

Using read_module instead of read_mib is practically the same, but
read_module  doesn't display any output, while read_mib will produce this
output
http://imgur.com/rbiieWf
When trying to print_mib to file the program then fails.

Any ideas what I did wrong here?

------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs

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