On 18 November 2011 07:40, prashant n <[email protected]> wrote:
>           I created  MIB table containing  data as float parameters
> using the (Net-SNMP specific) "NET-SNMP-TC::Float" type, as u suggested on
> previous mail.
>  This is how MIB table looks like
> AiEntry ::= SEQUENCE
> {
> aiDeviceId Integer32,
> aiAlarmTime Integer32,
>                 aiPin1 Float,
> aiPin2 Float,
> aiPin3 Float,
> aiPin4 Float,
> aiPin5 Float,
> aiPin6 Float,
> aiPin7 Float,
> aiPin8 Float
> }

Will there always be exactly eight "pin" values for a given device ID
& alarm time?
Could there conceivably ever be fewer or more than this?

Why not have a table with three indexes
   (aiDeviceId, aiAlarmTime, and aiPinId - which runs from 1..8)
and a single accessible column   'aiPinValue Float' ?


That would provide exactly the same information,  but support devices
(or alarms) with an arbitrary number of Pin values.




> 1) How to set limit for max number of rows for a table that will be created
> by the agent?

Describe any such limits within the DESCRIPTION clause in your table
definition.   Then check the number of existing rows within the code that
implements this table, before creating a new row in the table.

It might be worth defining a scalar object aiNumEntries,
to report the current number of rows in the table.

How will rows be created/deleted in this table?
Via SNMP, or automatically by the underlying system?


> 2) How to set default values in the table defined above ?

You can include a DEFVAL clause as part of the MIB object
definition.   See existing MIBs for examples of this.


> 3) Whether mib2c tool will be helpful to convert this MIB file(In general
> any MIB file) containing table to corresponding .c and .h files ? or we need
> to write .c and .h files manually ?

mib2c is useful (but not essential) for generating the template code
to implement this table.   It is perfectly possible to write the necessary
code from scratch, but mib2c will generate a basic framework for you.


> 4) Whether parameters declared as a indexes to the table in aiEntry must be
> an Integer32 ?

No.
You can have integer, string or even OIDs (or any combination of these
as indexes to a table.   About the only type that you can't use is Counters
(I'm not sure about Opaque - probably not - which would also rule out Float)


>  What is the purpose of specifing limit explictly in index parameters ?

Typically, to ensure that the index values lie within some restrictions imposed
by the underlying subsystem.   For example, if the aardwark module within the
kernel could only handle 100 entries at any one time, then the MIB table to
monitor this module might well be defined with an index range 1..100.

Dave

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to