[ First - *please* don't mail me privately, without copying
any responses to the mailing list. I don't have the time
or inclination to offer private, unpaid, SNMP consultancy.
Keep discussions to the list, where others can both learn
and offer advice. Thanks. ]
2009/7/1 ema <[email protected]>:
> i use the version :5.4.2.1
> suppose
> NETSNMP="/home/ema/cprog/net-snmp/net-snmp-5.4.2.1/"
> i run command like this in
> $NETSNMP_HOME/agent/mibgroup/certusnet/channelTable
> $NETSNMP_HOME/local/mib2c -c $NETSNMP_HOME/local/mib2c.mfd.conf channelTable
You would normally need to install the mib2c template files
(which should be handled by "make install"), and then
run
mib2c -c mib2c.mfd.conf channelTable
That should pick up the template files automatically - I wouldn't
expect to have to give a full path.
> (certusnet/channelTable are directories that i created)
> here's the channelTable mib definition
> CERTUSNET-IPTV-WATCHER-MIB DEFINITIONS ::= BEGIN
[snip]
> END
>
> of course, channelTable is one of the tables in
> CERTUSNET-IPTV-WATCHER-MIB.txt
It appears to be the *only* table in this MIB.
> and the oid of certusnet is enterprise oid that i apply from IANA org for my
> company
>
> after exec that command, it will generate a lot of files including
> channelTable_oids.h
> when i open it, i find two COLUMN_xxx have the same suffix number
Nope. That shouldn't happen.
I've just tried this with the MIB file you supplied, and it
constructs the channelTable_oids.h correctly.
The six column definitions all have unique values, as expected.
I don't know what might be different in your setup, but the
mib2c script seems to be working correctly.
> i run that command for many tablenodes, few XXX_oid.h files are correct,
> manytimes there're incorrect, some are in disorder, some have a big number
> between the two small numbers
I don't really understand this.
How can you run the command for "many tablenodes", when there is only
one table in the MIB file?
> #define CHANNELTABLE_OID 1,3,6,1,4,1,33620,1,5
> #define COLUMN_CHANNELINDEX 1
> #define COLUMN_CHANNELNAME 2
> #define COLUMN_CHANNELADDRESS 2
> #define COLUMN_MONITORED 4
> #define COLUMN_HANDLE 5
> #define COLUMN_CHANNELPORT 6
>
> when i comiple these files, it has errors like this
> channelTable_interface.c:617: error: duplicate case value
> channelTable_interface.c:608: error: previously used here
>
> this is where i found the error
> and when i correct it like this
> #define CHANNELTABLE_OID 1,3,6,1,4,1,33620,1,5
> #define COLUMN_CHANNELINDEX 1
> #define COLUMN_CHANNELNAME 2
> #define COLUMN_CHANNELADDRESS 3
> #define COLUMN_MONITORED 4
> #define COLUMN_HANDLE 5
> #define COLUMN_CHANNELPORT 6
>
> it can be compiled successfully
That's what is generated for me, so there should be no problem.
Dave
------------------------------------------------------------------------------
_______________________________________________
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