| < Prev | Back to Table of Contents | Next > |
Record and Database properties are queried using the
get subcommand for the database containing the specified
record or its self. The available properties depend on the record
type whose properties are desired, although a number of properties
(such as -name and -fullname) are shared by
most record types. Properties are also available that allow the user
to direct their query to properties such as OID values and types
either "as specified" directly in the definition of the
record or "as inherited" from any references to other
definitions, depending on which information is desired. This
get subcommand can also be used to obtain a list of
available databases.
Starting with version 3.0, multiple properties for a single record can be queried in one call. This can be used to optimize scripts that need to get several properties by avoiding the overhead of searching the database for the record with each individual property.
% dbcmd get ?property property ...?
?-exact? ?recordName?
..where dbcmd is the name of the database,
property is the name of the property desired,
and recordName is a record search string
(name, OID, or combination of such) identifying the record to be
queried. If the property and recordName
fields are omitted, then the get subcommand returns a
list of available databases (including the master database). Consult
the section on the appropriate record type for a list of available
properties.
The -exact option can be specified to force exact
matching of the search specification where extra subidentifiers may
have been provided. For example, querying most properties for
"sysDescr.0" will normally return the properties for
sysDescr. If -exact is specified, "sysDescr"
will match but "sysDescr.0" will generate an error due to
no record existing with that exact OID value.
The value of the specified property. If the property has not been set, then it may return either an empty string or "undefined" depending on the property.
If multiple properties are specified in the call, the result will be a list with each element corresponding to the individual property results, in the same order.
% smilib get -syntax sysDescr DisplayString
% smilib get -valuedecl exampleID exampleParent.a(1).3
% smilib get -value exampleID exampleParent.1.3
% smilib get -fulloid sysDescr.0 1.3.6.1.2.1.1.1.0
% smilib get -fulloid -fullname sysDescr.0 1.3.6.1.2.1.1.1.0 @File1!SNMPv2-MIB!sysDescr
| < Prev | Back to Table of Contents | Next > |