bottrap
< Prev Back to Table of Contents Next >

Scotty 'mib' Command Migration

The following table provides a basic mapping of Scotty MIB database related commands to MIB Smithy SDK. The information may be helpful as a starting point for migrating legacy scripts to use MIB Smithy SDK's native APIs for quering MIB module properties.

Querying the MAX-/MIN-/ACCESS Property
Scotty 2.0 mib ?-exact? access label
% mib access sysDescr
read-only
Scotty 3.0 Tnm::mib ?-exact? access label
% Tnm::mib access sysDescr
read-only
MIB Smithy SDK $db get ?-exact? -access label
% smilib get -access sysDescr
read-only
Getting a list of children in OID space
Scotty 2.0 mib ?-exact? successor label
% mib successor system
sysDescr sysObjectID sysUpTime sysContact sysName sysLocation sysServices sysORLastChange sysORTable
Scotty 3.0 Tnm::mib children label
% Tnm::mib children system
SNMPv2-MIB::sysDescr SNMPv2-MIB::sysObjectID SNMPv2-MIB::sysUpTime SNMPv2-MIB::sysContact SNMPv2-MIB::sysName SNMPv2-MIB::sysLocation SNMPv2-MIB::sysServices SNMPv2-MIB::sysORLastChange SNMPv2-MIB::sysORTable
MIB Smithy SDK $db get ?-exact? -subnodes label
% smilib get -subnodes system
sysDescr sysObjectID sysUpTime sysContact sysName sysLocation sysServices sysORLastChange sysORTable
Comparing OID Values
Scotty 2.0 Not Supported
Scotty 3.0 Tnm::mib compare oid1 oid2
% Tnm::mib compare 1.3.6.1 1.3.6.2
-1
MIB Smithy SDK $db oidcmp ?options? oid1 oid2
% smilib oidcmp 1.3.6.1 1.3.6.2
-1
Querying the DEFVAL Property
Scotty 2.0 mib ?-exact? defval label
% mib defval ifRcvAddressType
(zero-length string returned)
Scotty 3.0 Tnm::mib ?-exact? defval label
% Tnm::mib defval ifRcvAddressType
volatile
MIB Smithy SDK $db get ?-exact? -defval label
% smilib get -defval ifRcvAddressType
volatile
Querying the DESCRIPTION Property
Scotty 2.0 mib ?-exact? description label
% mib description sysDescr
A textual description of the entity. This value should
include the full name and version identification of the
system's hardware type, software operating-system, and
networking software.
Scotty 3.0 Tnm::mib description label
% Tnm::mib description sysDescr
A textual description of the entity. This value should
include the full name and version identification of the
system's hardware type, software operating-system, and
networking software.
MIB Smithy SDK $db get ?-exact? -description label
% smilib get -descr sysDescr
A textual description of the entity. This value should include the full name and version identification of the system's hardware type, software operating-system, and networking software.
Querying the DISPLAY-HINT Property
Scotty 2.0 Not Supported
Scotty 3.0 Tnm::mib ?-exact? displayhint label
% Tnm::mib displayhint DisplayString
255a
MIB Smithy SDK $db get ?-exact? -format label
% smilib get -format DisplayString
255a
Querying the Enumerations List of the SYNTAX Property
Scotty 2.0 Not Supported
Scotty 3.0 Tnm::mib enums type ?varName?
% mib enums ifType
unknown type "ifType"

% mib enums IANAifType
other 1 regular1822 2 hdh1822 3 ddnX25 4 rfc877x25 5 ...
MIB Smithy SDK smilib get ?-exact? -enums label
% smilib get -enums ifType
{other 1 {none of the following}} {regular1822 2} {hdh1822 3} {ddnX25 4} {rfc877x25 5} ...

% smilib get -enums IANAifType
{other 1 {none of the following}} {regular1822 2} {hdh1822 3} {ddnX25 4} {rfc877x25 5} ...
Determining if a Record is Defined
Scotty 2.0 Not Supported
Scotty 3.0 Tnm::mib exists label
% mib exists system
1
MIB Smithy SDK $db is defined label
% smilib is defined system
1
Determining the MIB File for a Record
Scotty 2.0 mib ?-exact? file label
% mib file system
/usr/local/lib/tnm2.1.9/mibs/rfc1907.mib
Scotty 3.0 Tnm::mib file label
% Tnm::mib file system
/usr/local/lib/tnm3.0.0/mibs/SNMPv2-MIB
MIB Smithy SDK $db get -filename fileHandle
% set fullName [smilib get -fullname system]
@File4!SNMPv2-MIB!system
% set fileHandle [lindex [split $fullname !] 0]
@File4
% $db get -filename $fileHandle
../../mibs/rfc3418.mib
Formatting Data Using DISPLAY-HINT
Scotty 2.0 mib ?-exact? format name value
Scotty 3.0 Tnm::mib format name value
MIB Smithy SDK $db format ?-nocomplain? name value
% smilib format RowStatus 6
destroy(6)
Querying the INDEX Property
Scotty 2.0 mib ?-exact? index label
% mib index sysORTable
sysORIndex
Scotty 3.0 Tnm::mib index label
% Tnm::mib index sysORTable
1.3.6.1.2.1.1.9.1.1
MIB Smithy SDK $db get ?-exact? -index label
% smilib get -index sysORTable
sysORIndex
Querying Constants (e.g. macro names)
Scotty 2.0 Not Supported
Scotty 3.0 Tnm::mib info subject ?pattern?
MIB Smithy SDK Not Supported
Determining a Record's Label (Descriptor)
Scotty 2.0 mib ?-exact? name oid
% mib name 1.3.6.1.2.1.1.1
sysDescr
Scotty 3.0 Tnm::mib label oid
% Tnm::mib label 1.3.6.1.2.1.1.1
sysDescr
MIB Smithy SDK smilib get ?-exact? -name oid
% smilib get -name 1.3.6.1.2.1.1.1
sysDescr
Determining OID Length
Scotty 2.0 Not Supported
Scotty 3.0 Tnm::mib length label
% Tnm::mib length system
7
MIB Smithy SDK llength [split [$db get -fulloid label] .]
% llength [split [$db get -fulloid system] .]
7
Loading MIB Files
Scotty 2.0 mib load filename
% mib load IANAifType-MIB.mib
Scotty 3.0 Tnm::mib load filename
% Tnm::mib load IANAifType-MIB.mib
MIB Smithy SDK $db import -file filename
% smilib import -file IANAifType-MIB.mib
1
Determining Record Type/Macro
Scotty 2.0 mib ?-exact? macro label
% mib macro sysDescr
OBJECT-TYPE
Scotty 3.0 Tnm::mib macro label
% Tnm::mib macro sysDescr
OBJECT-TYPE
MIB Smithy SDK $db whatis label
% smilib whatis sysDescr
leaf
Determining Group Members
Scotty 2.0 Not Supported
Scotty 3.0 Tnm::mib member label
% Tnm::mib member systemGroup
sysDescr sysObjectID sysUpTime sysContact sysName sysLocation sysServices sysORLastChange sysORID sysORUpTime sysORDescr
MIB Smithy SDK $db get -members label
% smilib get -members systemGroup sysDescr sysObjectID sysUpTime sysContact sysName sysLocation sysServices sysORLastChange sysORID sysORUpTime sysORDescr
Determining a Record's Parent Module
Scotty 2.0 mib ?-exact? module label
% mib module system
SNMPv2-MIB
Scotty 3.0 Tnm::mib module label
% Tnm::mib module system
SNMPv2-MIB
MIB Smithy SDK lindex [split [smilib get -container label] !] 1
% lindex [split [smilib get -container system] !] 1
SNMPv2-MIB
Determining a Record's OID Value
Scotty 2.0 mib ?-exact? oid label
% mib oid system
1.3.6.1.2.1.1
Scotty 3.0 Tnm::mib oid label
% Tnm::mib oid system
1.3.6.1.2.1.1
MIB Smithy SDK $db get -fulloid label
$db get -oid label
% smilib get -fulloid system
1.3.6.1.2.1.1

% smilib get -oid system
mib-2.1
purpose
Scotty 2.0 Not Supported
Scotty 3.0 Tnm::mib pack oid value ?value ...?
example
MIB Smithy SDK Not Supported
Determining an OID's Parent Record
Scotty 2.0 mib ?-exact? parent label
% mib parent sysDescr
system
Scotty 3.0 Tnm::mib parent label
% Tnm::mib parent sysDescr
SNMPv2-MIB::system
MIB Smithy SDK set fulloid [$db get ?-exact? -fulloid label]
set fulloid [join [lrange [split $fulloid .] 0 end-1] .]
$db get -name $fulloid
% set fulloid [smilib get -fulloid sysDescr]
1.3.6.1.2.1.1.1
% set fulloid [join [lrange [split $fulloid .] 0 end-1] .]
1.3.6.1.2.1.1
% smilib get -name sysDescr
system
Querying the Size/Range of the SYNTAX Property
Scotty 2.0 Not Supported
Scotty 3.0 Tnm::mib range label
Tnm::mib size label
% mib size sysDescr
unknown type "sysDescr"
% mib size DisplayString
0 255
MIB Smithy SDK $db get ?-exact? -range
$db get ?-exact? -size
% smilib get -size sysDescr
{0 255}
% smilib get -size DisplayString
{0 255}
Scanning DISPLAY-HINT Formatted Values
Scotty 2.0 mib ?-exact? scan name value
example
Scotty 3.0 Tnm::mib scan nodeOrType value
example
MIB Smithy SDK Not Supported (scanning is not possible in all cases)
Querying the STATUS Property
Scotty 2.0 Not Supported
Scotty 3.0 Tnm::mib status label
% Tnm::mib status sysDescr
current
MIB Smithy SDK $db get -status label
% smilib get -status sysDescr
current
OID Prefix Comparison
Scotty 2.0 Not Supported
Scotty 3.0 Tnm::mib subtree oid1 oid2
% Tnm::mib subtree system sysDescr
1
% Tnm::mib subtree system ifType
0
MIB Smithy SDK $db oidcmp -subtree parent child
% smilib oidcmp -subtree system sysDescr
0
% smilib oidcmp -subtree system ifType
1

Querying the SYNTAX Property
Scotty 2.0 mib ?-exact? syntax label
% mib syntax sysDescr
DisplayString
Scotty 3.0 Tnm::mib syntax label
Tnm::mib type label
% Tnm::mib syntax sysDescr
OCTET STRING
% Tnm::mib type sysDescr
SNMPv2-TC!DisplayString
MIB Smithy SDK $db get -syntax label
$db get -asn1type label
% smilib get -syntax sysDescr
DisplayString
% smilib get -asn1type sysDescr
OCTET STRING
Querying TEXTUAL-CONVENTION Details for OBJECT-TYPEs
Scotty 2.0 mib ?-exact? tc label
% mib tc sysDescr
DisplayString {OCTET STRING} 255a {} SNMPv2-TC /usr/local/lib/tnm2.1.9/mibs/rfc1903.tc
Scotty 3.0 Not Supported
MIB Smithy SDK Not Supported
Decoding INDEX Values from OIDs
Scotty 2.0 Not Supported
Scotty 3.0 Tnm::mib unpack oid
Tnm::mib split oid
% Tnm::mib unpack sysORDescr.6
6
% Tnm::mib split sysORDescr.6
1.3.6.1.2.1.1.9.1.3 6
MIB Smithy SDK $db get -indexparts oid
% smilib get -indexparts sysORDescr.6
sysORIndex 6 6
Determining Notification Members
Scotty 2.0 Not Supported
Scotty 3.0 Tnm::mib variables label
% Tnm::mib variables linkUp
ifIndex ifAdminStatus ifOperStatus
MIB Smithy SDK $db get -members label
% smilib get -members linkUp
ifIndex ifAdminStatus ifOperStatus
Walking a Subtree
Scotty 2.0 mib ?-exact? walk varName label command
% mib walk x sysORTable { puts $x }
sysORTable
sysOREntry
sysORIndex
sysORID
sysORDescr
sysORUpTime
Scotty 3.0 Tnm::mib ?-exact? walk varName label command
% Tnm::mib walk x sysORTable { puts $x }
1.3.6.1.2.1.1.9
1.3.6.1.2.1.1.9.1
1.3.6.1.2.1.1.9.1.1
1.3.6.1.2.1.1.9.1.2
1.3.6.1.2.1.1.9.1.3
1.3.6.1.2.1.1.9.1.4
MIB Smithy SDK Not Supported
< Prev Back to Table of Contents Next >