On Thu, Feb 19, 2015 at 7:06 AM, Tim Culhane <tim.j.culh...@gmail.com>
wrote:
> Hi,
>
> Can anybody explain to me the correct way of setting and retrieving details
> for a specific row in a mib table.
>
> For example, I want to create a shared object to manage a table which holds
> rows of data relating to counter values produced by a mail server.
>
> Row 1 would hold status counters, such as total number of messages
> delivered
> Row 2 would contain performance counters such as total number of messages
> delivered in the last 10 seconds.
>
I'm not sure you want a table to hold these items the way you think.
You only want a table if you have multiple instance of each counter.
Let me use your 'email' example and invent some mythical variables.
razorgateSmtpStatusBadHeader
razorgateSmtpStatusUnsupportedMimeType
razorgateSmtpStatusMsgTooLong
razorgateSmtpPerformanceTookTooLong
razorgateSmtpPerformancePeakSimultaneousMsgs
These counters/variables would be the columns in the table.
Each row would represent an instance of the set of variables.
(like each SMTP process)
If you only EVER have a single instance of the variables, then you don't
need (or want) a table containing the variables, (because a single row
would suffice). Not having a table would then simplify the indexing.
If you need a table then it would look like this:
1.2.3 razorgate
1.2.3.1 razorgateSmtpCountersTable
1.2.3.1.1 razorgateSmtpStatusCountersEntry
1.2.3.1.1.1 razorgateSmtpStatusBadHeader
1.2.3.1.1.2 razorgateSmtpStatusUnsupportedMimeType
1.2.3.1.1.3 razorgateSmtpStatusMsgTooLong
1.2.3.1.1.4 razorgateSmtpPerformanceTookTooLong
1.2.3.1.1.5 razorgateSmtpPerformancePeakSimultaneousMsgs
and the value of MsgTooLong' in row 1 would be located at: 1.2.3.1.1.3.1
the value in row 15 would be located at: 1.2.3.1.1.3.1.15
[Indexes always come last in the OID]
On the other hand, if you only have one instance of each counter/variable,
then
you don't need a table (and probably don't want a table). In which case
your variables
would look like this:
1.2.3 razorgate
1.2.3.1 razorgateSmtpCounters
1.2.3.1.1 razorgateSmtpStatusBadHeader
1.2.3.1.2 razorgateSmtpStatusUnsupportedMimeType
1.2.3.1.3 razorgateSmtpStatusMsgTooLong
1.2.3.1.4 razorgateSmtpPerformanceTookTooLong
1.2.3.1.5 razorgateSmtpPerformancePeakSimultaneousMsgs
so accessing the value of (you one and only) MsgTooLong' variable would be
at: 1.2.3.1.3.0
[i.e. index = 0 ]
I want to be able to use snmpget to access just the performance counters
> (i.e. all entries in the performance row), and also to access a specific
> column value in that row.
>
> So, lets say I define two entry objects in my table:
>
>
> razorgateSmtpStatusCountersEntry OBJECT-TYPE
> SYNTAX RazorgateSmtpCountersEntry
> MAX-ACCESS not-accessible
> STATUS current
> DESCRIPTION "row holding values of status counters"
> INDEX { razorgateTableIndex }
> ::= { razorgateSmtpCountersTable 1 }
>
>
> razorgateSmtpPerformanceCountersEntry OBJECT-TYPE
> SYNTAX RazorgateSmtpCountersEntry
> MAX-ACCESS not-accessible
> STATUS current
> DESCRIPTION "Row to hold values of performance
> counters"
> INDEX { razorgateTableIndex }
> ::= { razorgateSmtpCountersTable 2 }
>
> So, the way we index rows in the table is by the razorgateTableIndex field.
>
> For simplicity lets say my top level oid is 1.2.3
>
> If I want to access the smtpdCountersTable I would use 1.2.3.1
>
> If I wanted to access the first row in this table is it just a case of
> using:
>
> 1.2.3.1.1
>
> ?
>
> How then to I access a particular value in the first row, lets say total
> number of messages delivered?
>
> If I wanted to use names instead of numbers, how do I refer to a row in a
> table? What name matches the index value?
>
Rows in tables are identified by their index.
If you have a numeric index, then its a number,
but if you define the index as a string value then you would use a string.
Lastly, when loading my data into the table in the data access functions of
> my shared object, how do I distinguish between the individual rows in the
> table. In other words, if I get a get request for just the status counters
> how do I decide that this should go in row 1 of the table.
>
------------------------------------------------------------------------------
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=190641631&iu=/4140/ostg.clktrk
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders