Hello,

I've been implementing a module for the net-snmp agent. I'm successful in integrating the module with the agent. All the objects in the MIB were scalar variables.

Recently, I added a new object which corresponds to a table. This table object is given below. 'company' corresponds to the OID corresponding to the root of the MIB implemented. The initial 25 scalar objects are integrated successfully to the agent.

------------------------------------------------------
blockedIPList OBJECT-TYPE
SYNTAX SEQUENCE OF IPTable
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Table of 10 most recently blocked IPs"
::= { company 26 }


ipTable OBJECT-TYPE
SYNTAX IPTable
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
"An entry containing a blocked IP"
INDEX { ipIndex }
::= { blockedIPList 1 }


IPTable ::= SEQUENCE {
ipIndex Integer32,
ipEntry NetworkAddress
}


ipIndex OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Index for IP Table"
::= { ipTable 1 }


ipEntry OBJECT-TYPE
SYNTAX NetworkAddress
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Blocked IP Entry"
::= { ipTable 2 }
------------------------------------------------------


Now, I added a new module "company_table" in the same file company.c, and company.h.

1. Do I need to integrate the module explicitly somewhere? (This module is implemented in the same file as of the previous module).

2. The two modules are integrated as shown below:

oid company_variables_oid[] = { company};
struct variable4 company_variables[] = {
{LOGFULLPERCENT, ASN_INTEGER, RONLY, var_company, 1, {1 }},
...
...
{DISKFULLPERCENT , ASN_INTEGER, RONLY, var_company, 1, {25 }}
};


oid company_table_variables_oid[] = { company,26,1};
struct variable4 company_table_variables[] = {
{IPINDEX, ASN_INTEGER, RONLY, var_company_table, 1, {1}},
{IPENTRY, ASN_OCTET_STR, RONLY, var_company_table, 1, {2}}
};


Are the registration of the OIDs correct? I had this doubt because I've registered the 'company' OID, and without registering it's child 'company.26', I'm trying to register 'company.26.1'. Is this ok?

3. The snmpwalk returns this:
bash$ snmpwalk -v2c -c public 127.0.0.1 enterprises.company


SNMPv2-SMI::enterprises.company.1.0 = 0
...
...
...
SNMPv2-SMI::enterprises.company.25.0 = 57


The "company.26" table is not visible in the walk.

Can anybody give me some pointers to where I'm going wrong?

Thanks,
--Haris




-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com
_______________________________________________
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

Reply via email to