Home
You are not currently signed in.

MIB Smithy

  1. Up to Table of Contents

Creating Records and Databases

The new subcommand is used to create records of the specified type within the database identified by the database command. If no record type is specified, the new command creates a new database. Each database, including the master database, can be used to create new, empty databases.

Syntax:

% dbcmd new ?recordType? ?option value ...?

Where:

dbcmd
is the name of the database;
recordType
is an optional record type; and
option value
are paired values, same as those supported by the set command for the specified record type, which may be present to configure the record at creation time.

Returns:

  • Fully-qualified name of the created record.

Common Properties

-name name
The -name property, which is allowed for all record types except files and databases themselves, is used to specify the name of the new record. If no name is specified, the SDK will automatically assign a name that is guaranteed to be unique within the database.
-in record
The -in property is used to specify the parent/container record where appropriate. If the -in property is not specified, the location of the created record may be indeterminate, but is usually in the last appropriate container that was created, if any. (For example, creating a module record without specifying the file to create it in results in the module being placed within the last created file.) An error will result if no appropriate container exists (for example, attempting to create a conformance module if there are no conformance records).

Specifying Record Types

The values accepted for the recordType property are:

-capability
Create a new AGENT-CAPABILITIES record.
-cgroup
Create a new GROUP record within a MODULE-COMPLIANCE Module.
-cmodule
Create a new Conformance Module record in an AGENT-CAPABILITIES (INCLUDES) or MODULE-COMPLIANCE (MODULE) record.
-compliance
Create a new MODULE-COMPLIANCE record.
-file
Create a new File record.
-module
Create a new Module record.
-moduleid
Create a new MODULE-IDENTITY record.
-node
Create a new OBJECT-IDENTITY or OID Value Assignment.
-typedef
Create a new Type Assignment or TEXTUAL-CONVENTION.
-ngroup
Create a new NOTIFICATION-GROUP record.
-notification
Create a new NOTIFICATION-TYPE or TRAP-TYPE record.
-object
Create a new OBJECT-TYPE record.
-ogroup
Create a new OBJECT-GROUP record.
-variation
Create a new Variation in a Conformance Module.

See Also

Example 1 - Creating a new database:

% set db [smilib new]
smilib1

Example 2 - Creating a new file:

% set file [$db new -file]
@File1

Example 3 - Creating a new module:

% set module [$db new -module -name EXAMPLE-MIB -in $file]
@File1!EXAMPLE-MIB
  1. Up to Table of Contents