RE: query in mib2c

"Robson, Alan" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <2228BF4A620F664B97F85AF2B5E7507CE93D98EB@wdc1exchmbxp02.hq.corp.viasat.com>
Hi Janki

Did MIB2C also create any files for you that ended with the words: …_data_get.c or …_data_access.c  ?

I ask because when I ran MIB2C it generated these files to give me an opportunity to write functions that would be called when the SNMP agent wanted to fetch a value to return to the manager when it is polled. I wrote in those functions, compiled and ran the executable and it attached to the snmp agent as an agentx subagent.

But then I  used a different config file (mib for dummies) so I will have different results, but in any case someone needs to write some code to return values for the MIB variables. You may have done so but I did not see it in your email.

This page: http://www.net-snmp.org/wiki/index.php/TUT:mib2c_scalar
Says…

The mib2c scalar configuration file<http://net-snmp.git.sourceforge.net/git/gitweb.cgi?p=net-snmp/net-snmp;a=blob_plain;f=local/mib2c.scalar.conf;hb=HEAD> generates a bare-bones skeleton handler for each scalar object. You must then write code to provide data for the object, handling each mode.

Did you do that ?

Alan

From: Janki Chhatbar [mailto:[email protected]]
Sent: Tuesday, November 25, 2014 2:28 AM
To: [email protected]
Subject: Fwd: query in mib2c

Hi

I am working on net-snmp since past few days. I want lldpLocChassisId from Q-BRIDGE-MIB.
I have added the mib and able to translate the OIDs.
Now I want to do get.
I did mib2c -c mib2c.scalar.conf lldpdLocalSystemData. lldpLocSystemData.c and lldpLocSystemData.h files are generated in the folder /agent/mibgroup
I ran ./configure --with-mib-modules"lldpLocSystemData", make and sudo make install

lldpLocSystemData.o and lldpLocSystemData.lo files are generated.
When I do snmpget -v 2c -c public localhost Q-BRIDGE-MIB:: lldpLocChassisId, I get unidentified object error.
When I run gcc lldpLocSsytemData.c -c lldpLocSystemData.o, it gives undefined reference to functions snmp_get_do_debugging, debugmsgtoken, debugmsg, netsnmp_create_handle_registration, netsnmp_register_scalar, snmp_set_var_typed_value, snmp_log.

Can anyone please help me? I am attaching .c and .h files




Janki Chhatbar
M.Tech (Embedded Systems)
Nirma University
(+91) 9409239106

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk

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