Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Very Newbie: Converting a complex MIB file with mib2c

179 views
Skip to first unread message

Stavros Tsolakos

unread,
Jul 2, 2010, 9:11:28 AM7/2/10
to
Hi all.

I am really new to SNMP and net-snmp. I have a MIB file from a network
switch and i wanted to make a custom subagent to make the snmpd of my
workstation report some dummy data, as if it were the switch. I have
managed to build a subagent reporting a dummy integer value. But when
trying to use mib2c on the MIB file (I have configured it correctly,
mib2c can find both the MIB and the starting node) I am not sure of
which configuration file to use.

The MIB contains many tables, many scalar and many string values. Is
there a configuration file to automagically generate template code
which respects data types? Do I have to use mib2c separately for each
entry of my MIB?

Thank you very much and my apologies if the question is stupid. I am
very newbie and very confused, too.

Regards,

Stavros

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Net-snmp-users mailing list
Net-snm...@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Joan Landry

unread,
Jul 2, 2010, 9:51:27 AM7/2/10
to
You have to use mib2c for each table and scalor:
Example:
mib2c -c mib2c.scalar.conf SNMP-USER-BASED-SM-MIB:usmUserSpinLock
mib2c -c mib2c.table_data.conf SNMP-USER-BASED-SM-MIB:usmUserTable

Dave Shield

unread,
Jul 7, 2010, 5:33:05 AM7/7/10
to
On 2 July 2010 14:51, Joan Landry <Joan....@overturenetworks.com> wrote:
> You have to use mib2c for each table and scalor:
> Example:
> mib2c -c mib2c.scalar.conf SNMP-USER-BASED-SM-MIB:usmUserSpinLock
> mib2c -c mib2c.table_data.conf SNMP-USER-BASED-SM-MIB:usmUserTable

Minor correction:
You should be able to run "mib2c -c mib2c.scalar.conf" once, giving it the
root of the MIB in question, and it will generate code for *all* scalar objects
within that MIB.

But for tables, it is normal to run mib2c on each table individually.

Dave

0 new messages