[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Mibble-users] SOME DOUBTS ABOUT MIB
From: |
Per Cederberg |
Subject: |
Re: [Mibble-users] SOME DOUBTS ABOUT MIB |
Date: |
Sun, 23 May 2004 14:12:26 +0200 |
Hi Daniel,
On Sat, 2004-05-22 at 16:39, Daniel IWASHITA wrote:
> appSis OBJECT-TYPE
> SYNTAX DisplayString (SIZE(0..255))
> MAX-ACCESS read-only
> STATUS current
> DESCRIPTION
> "sistema da aplicacao"
> ::= { app 1 }
>
> I'D LIKE TO KNOW IF THERE IS A WAY TO ACCESS THE
> FIELDS THAT BELONGS TO OBJECT-TYPE "GROUP" (THE
> SYNTAX, MAX-ACCESS, STATUS AND DESCRIPTION FIELDS).
Here's a simple example on how to extract the fields:
sym = (MibValueSymbol) mib.getSymbol("appSis");
type = (SnmpObjectType) sym.getType();
subtype = type.getSyntax();
access = type.getAccess();
status = type.getStatus();
desc = type.getDescription();
Note that the code above assumes the types of values
returned. I recommend you check with instanceof to
avoid potential run-time exceptions.
Also, the MibType value returned by getSyntax() might
be a bit tricky to understand. In the case above it
ought to be an instance of StringType with the
appropriate size constraint set. You may wish to check
for "DisplayString" in which case you'd do:
subtype.hasReferenceTo("DisplayString")
> I ALSO WOULD LIKE TO MAKE BOTH SET AND GET IN THESE
> FIELDS.
Mibble is a MIB parser, i.e. it allows you to read the
contents of a MIB file. It does not provide support for
modifying MIB files nor does it contain an SNMP stack
(whichever you meant).
> THANKS IN ADVANCE
No problem.
Cheers,
/Per
--
Per Cederberg, Software Consulting
http://www.percederberg.net/software