? Agent++ & MIB
Kumar, Vinay 2
Vinay____barco.com
Tue May 29 06:14:05 CEST 2001
Hello Frank,
Thanks for the reply.
This all confusion came into my mind because in David Perkins book of
"Understanding SNMP MIBs", on page 28 in paragraph after figure 2-10, it has
been written that :
1. for Table Identifier : we use prefix describing Table & suffix of Table,
like ifTable
2. Row Identifier : we use the same prefix as Table & suffix of Entry, like
ifEntry.
****************************************************************************
*********************************
So i thought that OID(MibTable created in Source code) == OID (ifTable)
But, now you correct me up that it is of ifEntry, [ i find it nowhere
documented ]
****************************************************************************
*********************************
on the basis of the example, i have asked you, i have written a mib.
pl. correct me, if i'm right.
MINE DEFINITIONS ::= BEGIN
IMPORTS
enterprises
FROM RFC1155-SMI
DisplayString
FROM RFC1213-MIB
OBJECT-TYPE
FROM RFC-1212;
mine OBJECT IDENTIFIER ::= { enterprises 555.55 }
ifTable OBJECT-TYPE
SYNTAX SEQUENCE OF IfEntry
ACCESS not-accessible
STATUS mandatory
DESCRIPTION "OID(Table) = 1.3.6.1.4.1.555.55.1"
::= { mine 1}
ifEntry OBJECT-TYPE
SYNTAX IfEntry
ACCESS not-accessible
STATUS mandatory
DESCRIPTION
"OID(Entry) = "1.3.6.1.4.1.555.55.1.1
The desired ROW ranges between 0..255"
INDEX { col1, col2, col3, col4 }
::= { ifTable 1 }
IfEntry ::= SEQUENCE
{
col1 INTEGER,
col2 DisplayString,
col3 INTEGER,
col4 DisplayString
}
col1 OBJECT-TYPE
SYNTAX INTEGER(0..255)
ACCESS not-accessible
STATUS mandatory
DESCRIPTION "OID(col1) = 1.3.6.1.4.1.555.55.1.1.0"
::= { ifEntry 0 }
col2 OBJECT-TYPE
SYNTAX DisplayString (SIZE (0..12))
ACCESS not-accessible
STATUS mandatory
DESCRIPTION "OID(col2) = 1.3.6.1.4.1.555.55.1.1.1"
::= { ifEntry 1 }
col3 OBJECT-TYPE
SYNTAX INTEGER(-20000..20000)
ACCESS not-accessible
STATUS mandatory
DESCRIPTION "OID(col3) = 1.3.6.1.4.1.555.55.1.1.2"
::= { ifEntry 2 }
col4 OBJECT-TYPE
SYNTAX DisplayString
ACCESS not-accessible
STATUS mandatory
DESCRIPTION "OID(col4) = 1.3.6.1.4.1.555.55.1.1.3"
::= { ifEntry 3 }
--
END
--
Isn't there any way in your framework to create the MIB using some API since
we design the whole thing in the code & your framework is completly aware of
the MIB we are creating.
Thanks & regards.
VINK
-----Original Message-----
From: Frank.Fock____t-online.de [mailto:Frank.Fock____t-online.de]
Sent: Monday, May 28, 2001 11:33 PM
To: Kumar, Vinay 2
Cc: 'agentpp-dl____agentpp.com'
Subject: Re: ? Agent++ & MIB
Hi Vinay,
Please find my answer inline:
"Kumar, Vinay 2" wrote:
> Table::Table (string anOID): MibTable (anOID.c_str(), 0, FALSE)
> {
> instance = this; //col =
> add_col (new Property (parameter1)); //1
> add_col (new Property (parameter2)); //2
> add_col (new Property (parameter3)); //3
> add_col (new Property (parameter4)); //4
> add_col (new Property (parameter5)); //5
> }
> ///////////
> void Table::AddRow (char* numRow)
> {
> add_row (numRow);
> }
> ///////////
> void mainProcedure(Mib* mib)
> {
> Table *T = new Table("1.3.6.1.4.1.555.55");
> t->AddRow("1"); //row = 1
> t->AddRow("2"); //row = 2
> mib->add(T);
> }
> //////////
>
> ?how do i show this structure in the MIB file.
It seems that your qustion is a basic one. Did you read
already "Understanding SNMP MIBs" by D. Perkins?
It is a really good book and it explains tables thoroughly.
>
> ?what OID i give if i want to access 5th column of the 2nd row.
>
You should create your table with:
Table *T = new Table("1.3.6.1.4.1.555.55.1");
because AGENT++ needs the OID of the ENTRY object.
With the above you would access the 5th column of the 2nd row with:
1.3.6.1.4.1.555.55.1.5.2
Best regards,
Frank
More information about the AGENTPP
mailing list