RFC 3165
Definitions of Managed Objects for the Delegation of Management Scripts
Part 1 of 11 π
Definitions of Managed Objects for the Delegation of Management Scripts π
Request for Comments: 3165 Obsoletes: 2592 Category: Standards Track Date: August 2001 Authors: D. Levi (Nortel Networks) and J. Schoenwaelder (TU Braunschweig)
Status of This Memo π
okay so this document specifies an Internet standards track protocol for the Internet community, and it's asking for discussion and suggestions for improvements π«Ά for the current standardization state and status of this protocol, check the current edition of the "Internet Official Protocol Standards" (STD 1). distribution of this memo is unlimited, so share it with everyone π
Copyright Notice βοΈ
Copyright (C) The Internet Society (2001). All Rights Reserved.
Abstract β¨
this memo defines a portion of the Management Information Base (MIB) for use with network management protocols in the Internet community. basically it describes a set of managed objects that let you delegate management scripts to distributed managers π¦
Table of Contents ποΈ
1 Introduction ................................................. 3
2 The SNMP Management Framework ................................ 3
3 Overview ..................................................... 4
3.1 Terms ...................................................... 5
4 Requirements and Design Issues ............................... 6
4.1 Script Languages ........................................... 6
4.2 Script Transfer ............................................ 7
4.3 Script Execution ........................................... 8
5 Structure of the MIB ......................................... 9
5.1 Language Group ............................................. 9
5.2 Script Group ............................................... 10
5.3 Code Group ................................................. 11
5.4 Launch Group ............................................... 11
5.5 Run Group .................................................. 11
6 Definitions .................................................. 12
7 Usage Examples ............................................... 49
7.1 Pushing a Script via SNMP .................................. 49
7.2 Pulling a Script from a URL ................................ 50
7.3 Modifying an Existing Script ............................... 50
7.4 Removing an Existing Script ................................ 51
7.5 Creating a Launch Button ................................... 51
7.6 Launching a Script ......................................... 52
7.7 Suspending a Running Script ................................ 52
7.8 Resuming a Suspended Script ................................ 53
7.9 Terminating a Running Script ............................... 53
7.10 Removing a Terminated Script .............................. 54
7.11 Removing a Launch Button .................................. 54
8 VACM Configuration Examples .................................. 54
8.1 Sandbox for Guests ......................................... 55
8.2 Sharing Scripts ............................................ 55
8.3 Emergency Scripts .......................................... 56
9 IANA Considerations .......................................... 57
10 Security Considerations ..................................... 57
11 Intellectual Property ....................................... 59
12 Changes from RFC 2592 ....................................... 59
13 Acknowledgments ............................................. 61
14 References .................................................. 61
15 Editors' Addresses .......................................... 63
16 Full Copyright Statement .................................... 64
1. Introduction πΈ
this memo defines a portion of the Management Information Base (MIB) for use with network management protocols in the Internet community. in particular, it describes a set of managed objects that allow the delegation of management scripts to distributed managers.
the key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [RFC2119]. these are the official BCP 14 words, so pay attention to them π
2. The SNMP Management Framework π§
the SNMP Management Framework currently has five major components:
- An overall architecture, described in RFC 2571 [RFC2571].
- Mechanisms for describing and naming objects and events for the purpose of management. The first version of this Structure of Management Information (SMI) is called SMIv1 and is described in STD 16, RFC 1155 [RFC1155], STD 16, RFC 1212 [RFC1212] and RFC 1215 [RFC1215]. The second version, called SMIv2, is described in STD 58, RFC 2578 [RFC2578], STD 58, RFC 2579 [RFC2579] and STD 58, RFC 2580 [RFC2580].
- Message protocols for transferring management information. The first version of the SNMP message protocol is called SNMPv1 and is described in STD 15, RFC 1157 [RFC1157]. A second version of the SNMP message protocol, which is not an Internet standards track protocol, is called SNMPv2c and is described in RFC 1901 [RFC1901] and RFC 1906 [RFC1906]. The third version of the message protocol is called SNMPv3 and is described in RFC 1906 [RFC1906], RFC 2572 [RFC2572] and RFC 2574 [RFC2574].
- Protocol operations for accessing management information. The first set of protocol operations and associated PDU formats is described in STD 15, RFC 1157 [RFC1157]. A second set of protocol operations and associated PDU formats is described in RFC 1905 [RFC1905].
- A set of fundamental applications described in RFC 2573 [RFC2573], and the view-based access control mechanism described in RFC 2575 [RFC2575].
a more detailed introduction to the current SNMP Management Framework can be found in RFC 2570 [RFC2570] π
managed objects are accessed via a virtual information store, called the Management Information Base or MIB. objects in the MIB are defined using the mechanisms defined in the SMI.
this memo specifies a MIB module that is compliant to the SMIv2. a MIB conforming to the SMIv1 can be produced through the appropriate translations. the resulting translated MIB must be semantically equivalent, except where objects or events are omitted because no translation is possible (use of Counter64). some machine readable information in SMIv2 will be converted into textual descriptions in SMIv1 during the translation process. however, this loss of machine readable information is not considered to change the semantics of the MIB. π€
3. Overview π¦
the Script MIB module defined in this memo can be used to delegate management functions to distributed managers. management functions are defined as management scripts written in a management scripting language. this MIB makes no assumptions about the language itself and even allows distribution of compiled native code, if an implementation is able to execute native code under the control of this MIB. β¨
the Script MIB defines a standard interface for the delegation of management functions based on the Internet management framework. in particular, it provides the following capabilities:
- Capabilities to transfer management scripts to a distributed manager.
- Capabilities for initiating, suspending, resuming and terminating management scripts.
- Capabilities to transfer arguments for management scripts.
- Capabilities to monitor and control running management scripts.
- Capabilities to transfer the results produced by running management scripts.
this memo does not address any additional topics, like the generation of notifications or how to address remote agents from a Script MIB implementation. π
3.1. Terms π·οΈ
this section defines the terms used throughout this memo.
- A "distributed manager" is a processing entity which is capable of performing network management functions. For the scope of this memo, a distributed manager is assumed to implement the Script MIB.
- A "higher-level manager", or just "manager", is a processing entity or human who initiates and controls the operations performed by one or more distributed managers.
- A "management script" is a set of instructions written in an executable language which implements a management function.
- A "management scripting language" is a language used to write management scripts. The term scripting language does not imply that the language must have the characteristics of scripting languages (e.g., string orientation, interpretation, weak typing). The MIB defined in this memo also allows to control management scripts written in arbitrary compiled system programming languages. π»
- A "distributed manager" can be decomposed into an "SNMP entity" which implements the Script MIB defined in this memo and the "runtime system" that executes scripts. The Script MIB sees the runtime system as the managed resource which is controlled by the MIB.
The runtime system can act as an SNMP application, according to the SNMP architecture defined in RFC 2571 [RFC2571]. For example, a runtime system which sends SNMP requests to other SNMP entities will act as a command generator application. The SNMP applications in the runtime system may use the same SNMP engine which also serves the command responder application used to implement the Script MIB, but they are not required to do so.
- A "launch button" is the conceptual button used to start the execution of a management script. It assigns control parameters to a management script. In particular, it defines the ownership of the scripts started from a launch button. The ownership can be used by the language runtime system to enforce security profiles on a running management script. π
4. Requirements and Design Issues π
this section discusses some general requirements that have influenced the design of the Script MIB.
- The Script MIB must not make any assumptions about specific languages or runtime systems.
- The Script MIB must provide mechanisms that help to avoid new management problems (e.g., script version problems).
- The Script MIB must provide SNMP interfaces to all functions required to delegate management scripts. However, other protocols might be used in addition if they provide a significant improvement in terms of convenience for implementation or performance.
- The Script MIB must be organized so that access can be controlled effectively by using view-based access control [RFC2575].
the following sections discuss some design issues in more detail. π
4.1. Script Languages π
Okay so the Script MIB doesn't care what language your script is written in π§ It makes no assumption about the script language, which means it can work with different languages (like Tcl or Java) and/or different versions of the same language. It also doesn't assume anything about the format scripts are transferred in π
The Script MIB lets a manager check which language versions an implementation supports, so the manager knows what the implementation can actually do β¨ Languages and language versions are identified like this:
- The language is identified by an object identifier. Object identifiers for well-known languages will be registered by the Internet Assigned Numbers Authority (IANA). Enterprise specific languages can also be registered in the enterprise specific OID subtree πΈ
- A particular version of a language is identified by a language version number. Honestly, a language object identifier plus a language version is usually enough to tell whether a script can run or not π
- Different implementations of the same language version might behave differently π That can happen because the language definition is ambiguous or because an implementor added extra features. So there's an additional object identifier value that identifies the organization that provides the implementation. Scripts that need one specific implementation can use this to pick it π
- There can also be different versions of a language implementation. A version number for the implementation lets the manager tell apart different implementations from the same organization, even for the same language version π
The version numbers can be used in two ways: a manager can pick the language version it needs to run a particular script, or it can pick a script that fits the language versions a particular Script MIB implementation supports. Iconic flexibility, periodt π¦
There's also a separate table for language extensions, which add features the core language doesn't have π§© Honestly, extensions are usually what turns a general purpose language into a management language. In lots of cases they come as libraries that do things like sending SNMP requests to remote SNMP agents or accessing the local MIB instrumentation. Every extension is tied to a language and has its own version numbers, so it gets its own little ID card πͺͺ
4.2. Script Transfer π
There are two ways to get management scripts over to a distributed manager, and they're giving very different vibes π The first is the push model'. Here the manager pushes the script to the distributed manager. The second is the pull model'. In this one, the manager tells the distributed manager where the script lives, and the distributed manager goes and grabs it itself π§²
The MIB in this memo supports both models π The `push model' is handled by a table. The manager writes a script by sending a sequence of SNMP set requests. Because of SNMP message size limits, the script can be split into several fragments π§©
The `pull model' uses Uniform Resource Locators (URLs) [RFC2396] that point to the script source. The manager writes the URL into the distributed manager with an SNMP set request. After that, the distributed manager is in charge of retrieving the document, using whatever protocol the URL names. That means protocols like FTP [RFC959] or HTTP [RFC2616] can be used to move big management scripts around efficiently β¨
The Script MIB also allows scripts that are hard-wired into the Script MIB implementation π These built-in scripts can live in a language runtime system, or they can be built natively into the Script MIB implementation. Implementing the push model' or the pull model' is not required for this.
Scripts can be stored in non-volatile storage πΎ That lets a distributed manager restart its scripts after it restarts, which is called an off-line restart. If a script is backed up in non-volatile storage, a manager doesn't have to push it back into the distributed manager after a restart. Less work, more slay π
Every script has an administratively assigned name π·οΈ That name can be used to work out the name the script gets in non-volatile storage. How the mapping works is implementation specific. The mapping has to handle scripts that have the same administrative name but are owned by different managers. One way to do that is to use the script owner along with the script name to derive the internal name used for the script in non-volatile storage π«Ά
4.3. Script Execution β‘
The Script MIB lets you run several instances of the same management script, or different ones, at the same time π₯ Script arguments are passed as OCTET STRING values. A script returns a single result value, which is also an OCTET STRING value. What the result values mean is left up to the manager that invoked the script or to other management scripts. So the invoker has to understand the format and meaning of both the arguments and the results of any script it calls π§
Scripts can also export complex results through a MIB interface π That means a management application can access and use script results the same way it handles any other MIB data. The Script MIB doesn't give any special support for building MIBs through scripts, though π
Runtime errors end active scripts π An exit code and a human readable error message get left in the MIB. When a script ends with an error exit code, a notification is generated that contains the exit code, the error message and a timestamp π
Script arguments and results don't have size limits beyond the ones set by the SMI and the SNMP protocol. Implementations of this MIB might have extra restrictions, though π¬ So if script results could be really large, a script designer might decide to return them through other mechanisms. One option is to return a URL as the script result, pointing to the file that holds the script output π
Heads up: implementations can have their own restrictions on top of the SMI and SNMP limits, so big results might need another route.
Executing scripts have a status object attached, and it lets you suspend, resume, or abort the script β―οΈ The exact meaning of suspend and resume depends on the language and runtime system. Some runtime systems may choose not to implement suspend/resume at all π€·ββοΈ
A history of finished scripts is kept in the MIB π That means a script invoker can collect results later on, which is the offline operation. Control objects decide how entries in the history get aged out when the table fills up ποΈ
5. Structure of the MIB π
This section shows how the MIB is put together π§ The objects are arranged into these groups:
- language group (
smLangTable,smExtsnTable) - script group (
smScriptTable) - script code group (
smCodeTable) - script launch group (
smLaunchTable) - running script group (
smRunTable)
5.1. Language Group π
The smLanguageGroup gives information about the languages and language extensions a Script MIB implementation supports π
It has two tables. The smLangTable lists every language the implementation supports, and the smExtsnTable lists the extensions available for a given language.
5.2. Script Group π
The smScriptGroup is a single table, called the smScriptTable. It lists every script the Script MIB implementation knows about π The table has objects that let you do these things:
- download scripts from a URL (pull model)
- read scripts from local non-volatile storage
- store scripts in local non-volatile storage
- delete scripts from local non-volatile storage
- list permanent scripts (that can not be changed or removed)
- read and modify the script status (enabled, disabled, editing)
The smScriptOperStatus object lets a manager see the current status of a script π It's also how you find out if an operation from the list above failed. To request a status change, you modify the smScriptAdminStatus object that goes with the script π
The smScriptSource object defines where a script comes from π It can hold a URL that points to a remote location where the management script is available. If smScriptSource holds an empty URL, the script source gets read from non-volatile storage instead. Otherwise it's read from the smCodeTable, which we'll get to in a sec π«Ά The smScriptStorageType object is what tells apart scripts read from non-volatile storage and scripts read from the smCodeTable π§
Scripts load automatically once smScriptAdminStatus is set to enabled'. Loading means retrieving the script (maybe from a remote location), compiling it for languages that need a compilation step, and making the code available to the runtime system π οΈ The smScriptOperStatusobject shows how loading is going. It starts in the stateretrieving', then switches to compiling', and finally reaches enabled'. If something goes wrong during retrieval or compilation, you end up in an error state like `compilationFailed' π
5.3. Code Group π§βπ»
The smCodeGroup is a single table, the smCodeTable. It lets you transfer and change scripts with SNMP set requests β¨ Specifically, the smCodeTable lets you do these things:
- download scripts via SNMP (push model)
- modify scripts via SNMP (editing)
The smCodeTable holds the code of a script. A script can be split across multiple rows of the smCodeTable to get around SNMP message size limits π§© You can only change the smCodeTable while the associated smScriptOperStatus object is editing'. Once smScriptOperStatusgoes back toenabled', the Script MIB implementation reloads the modified script code π
Implementing the smCodeGroup is optional π
5.4. Launch Group π
The smLaunchGroup contains one table, the smLaunchTable. Each entry in it is like a launch button for starting a script π The smLaunchTable lets you do these things:
- associate a script with an owner used during script execution
- provide arguments and parameters for script invocation
- invoke scripts with a single set operation
The smLaunchTable describes scripts and their parameters that are ready to launch π― An entry attaches an argument to a script, plus control values. For example, those control values can define the maximum number of times a script invoked from a particular row in the smLaunchTable may be running at the same time π’
An entry in the smLaunchTable also defines the owner that will be used to link permissions to the script execution π
5.5. Run Group πββοΈπ¨
okay so the smRunGroup holds one table, the smRunTable, and it's basically the guest list for every script that's running right now or wrapped up recently π bestie, this table is where the drama happens. The smRunTable gives you objects that let you:
- retrieve status information from running scripts
- control running scripts (suspend, resume, abort)
- retrieve results from recently terminated scripts
- control the remaining maximum lifetime of a running script
- control how long script results are accessible
Every row in the smRunTable holds the argument that was passed when the script got invoked, the result the script produced, and the script exit code π¦ It also tells you the current run state and the start and end time-stamps, so you can see exactly when everything happened β° There are three writable objects in here, and they're the ones you can actually play with π«Ά smRunLifeTime sets the maximum time a running script can keep going before the Script MIB implementation terminates it β³ smRunExpireTime decides how long a finished script can hang out in the smRunTable before it gets aged out π And smRunControl is the big red button that lets you suspend, resume, or abort running scripts π₯
6. Definitions β¨
Here's the MIB module itself, so grab a snack πΏ It's giving very precise, very verbatim, and every character matters π
DISMAN-SCRIPT-MIB DEFINITIONS ::= BEGIN
IMPORTS
MODULE-IDENTITY, OBJECT-TYPE, NOTIFICATION-TYPE,
Integer32, Unsigned32, mib-2
FROM SNMPv2-SMI
RowStatus, TimeInterval, DateAndTime, StorageType, DisplayString
FROM SNMPv2-TC
MODULE-COMPLIANCE, OBJECT-GROUP, NOTIFICATION-GROUP
FROM SNMPv2-CONF
SnmpAdminString
FROM SNMP-FRAMEWORK-MIB;
scriptMIB MODULE-IDENTITY
LAST-UPDATED "200108210000Z"
ORGANIZATION "IETF Distributed Management Working Group"
CONTACT-INFO
"WG EMail: disman@dorothy.bmc.com
Subscribe: disman-request@dorothy.bmc.com
Chair: Randy Presuhn
BMC Software, Inc.
Postal: Office 1-3141
2141 North First Street
San Jose, California 95131
USA
EMail: rpresuhn@bmc.com
Phone: +1 408 546-1006
Editor: David B. Levi
Nortel Networks
Postal: 4401 Great America Parkway
Santa Clara, CA 95052-8185
USA
EMail: dlevi@nortelnetworks.com
Phone: +1 423 686 0432
Editor: Juergen Schoenwaelder
TU Braunschweig
Postal: Bueltenweg 74/75
38106 Braunschweig
Germany
EMail: schoenw@ibr.cs.tu-bs.de
Phone: +49 531 391-3283"
DESCRIPTION
"This MIB module defines a set of objects that allow to
delegate management scripts to distributed managers."
REVISION "200108210000Z"
DESCRIPTION
"Revised version, published as RFC 3165.
This revision introduces several new objects: smScriptError,
smScriptLastChange, smLaunchError, smLaunchLastChange,
smLaunchRowExpireTime, smRunResultTime, and smRunErrorTime.
The following existing objects were updated: the maximum
value of smRunLifeTime now disables the timer, an
autostart value was added to the smLaunchAdminStatus
object, and a new expired state was added to the
smLaunchOperStatus object.
A new smScriptException notification has been added to
support runtime error notifications.
Created new conformance and compliance statements that
take care of the new objects and notifications.
Clarifications have been added in several places to remove
ambiguities or contradictions that were discovered and
reported by implementors."
REVISION "199902221800Z"
DESCRIPTION
"Initial version, published as RFC 2592."
::= { mib-2 64 }
--
-- The groups defined within this MIB module:
--
smObjects OBJECT IDENTIFIER ::= { scriptMIB 1 }
smNotifications OBJECT IDENTIFIER ::= { scriptMIB 2 }
smConformance OBJECT IDENTIFIER ::= { scriptMIB 3 }
--
-- Script language and language extensions.
--
-- This group defines tables which list the languages and the
-- language extensions supported by a Script MIB implementation.
-- Languages are uniquely identified by object identifier values.
--
smLangTable OBJECT-TYPE
SYNTAX SEQUENCE OF SmLangEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
"This table lists supported script languages."
::= { smObjects 1 }
smLangEntry OBJECT-TYPE
SYNTAX SmLangEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
"An entry describing a particular language."
INDEX { smLangIndex }
::= { smLangTable 1 }
SmLangEntry ::= SEQUENCE {
smLangIndex Integer32,
smLangLanguage OBJECT IDENTIFIER,
smLangVersion SnmpAdminString,
smLangVendor OBJECT IDENTIFIER,
smLangRevision SnmpAdminString,
smLangDescr SnmpAdminString
}
smLangIndex OBJECT-TYPE
SYNTAX Integer32 (1..2147483647)
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
"The locally arbitrary, but unique identifier associated
with this language entry.
The value is expected to remain constant at least from one
re-initialization of the entity's network management system
to the next re-initialization.
Note that the data type and the range of this object must
be consistent with the definition of smScriptLanguage."
::= { smLangEntry 1 }
smLangLanguage OBJECT-TYPE
SYNTAX OBJECT IDENTIFIER
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"The globally unique identification of the language."
::= { smLangEntry 2 }
smLangVersion OBJECT-TYPE
SYNTAX SnmpAdminString (SIZE (0..32))
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"The version number of the language. The zero-length string
shall be used if the language does not have a version
number.
It is suggested that the version number consist of one or
more decimal numbers separated by dots, where the first
number is called the major version number."
::= { smLangEntry 3 }
smLangVendor OBJECT-TYPE
SYNTAX OBJECT IDENTIFIER
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"An object identifier which identifies the vendor who
provides the implementation of the language. This object
identifier SHALL point to the object identifier directly
below the enterprise object identifier {1 3 6 1 4 1}
allocated for the vendor. The value must be the object
identifier {0 0} if the vendor is not known."
::= { smLangEntry 4 }
smLangRevision OBJECT-TYPE
SYNTAX SnmpAdminString (SIZE (0..32))
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"The version number of the language implementation.
The value of this object must be an empty string if
version number of the implementation is unknown.
It is suggested that the value consist of one or more
decimal numbers separated by dots, where the first
number is called the major version number."
::= { smLangEntry 5 }
smLangDescr OBJECT-TYPE
SYNTAX SnmpAdminString
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"A textual description of the language."
::= { smLangEntry 6 }
smExtsnTable OBJECT-TYPE
SYNTAX SEQUENCE OF SmExtsnEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
"This table lists supported language extensions."
::= { smObjects 2 }
smExtsnEntry OBJECT-TYPE
SYNTAX SmExtsnEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
"An entry describing a particular language extension."
INDEX { smLangIndex, smExtsnIndex }
::= { smExtsnTable 1 }
SmExtsnEntry ::= SEQUENCE {
smExtsnIndex Integer32,
smExtsnExtension OBJECT IDENTIFIER,
smExtsnVersion SnmpAdminString,
smExtsnVendor OBJECT IDENTIFIER,
smExtsnRevision SnmpAdminString,
smExtsnDescr SnmpAdminString
}
smExtsnIndex OBJECT-TYPE
SYNTAX Integer32 (1..2147483647)
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
"The locally arbitrary, but unique identifier associated
with this language extension entry.
The value is expected to remain constant at least from one
re-initialization of the entity's network management system
to the next re-initialization."
::= { smExtsnEntry 1}
smExtsnExtension OBJECT-TYPE
SYNTAX OBJECT IDENTIFIER
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"The globally unique identification of the language
extension."
::= { smExtsnEntry 2 }
smExtsnVersion OBJECT-TYPE
SYNTAX SnmpAdminString (SIZE (0..32))
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"The version number of the language extension.
It is suggested that the version number consist of one or
more decimal numbers separated by dots, where the first
number is called the major version number."
::= { smExtsnEntry 3 }
smExtsnVendor OBJECT-TYPE
SYNTAX OBJECT IDENTIFIER
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"An object identifier which identifies the vendor who
provides the implementation of the extension. The
object identifier value should point to the OID node
directly below the enterprise OID {1 3 6 1 4 1}
allocated for the vendor. The value must by the object
identifier {0 0} if the vendor is not known."
::= { smExtsnEntry 4 }
smExtsnRevision OBJECT-TYPE
SYNTAX SnmpAdminString (SIZE (0..32))
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"The version number of the extension implementation.
The value of this object must be an empty string if
version number of the implementation is unknown.
It is suggested that the value consist of one or more
decimal numbers separated by dots, where the first
number is called the major version number."
::= { smExtsnEntry 5 }
smExtsnDescr OBJECT-TYPE
SYNTAX SnmpAdminString
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"A textual description of the language extension."
::= { smExtsnEntry 6 }
--
-- Scripts known by the Script MIB implementation.
--
-- This group defines a table which lists all known scripts.
-- Scripts can be added and removed through manipulation of the
-- smScriptTable.
--
smScriptObjects OBJECT IDENTIFIER ::= { smObjects 3 }
The next bit is where the scripts themselves get their own table, so stay tuned π§π
okay bestie, this is where the script table really gets going π It's the list of every script the agent knows about, plus all the little details that describe each one β¨
smScriptTable OBJECT-TYPE
SYNTAX SEQUENCE OF SmScriptEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
"This table lists and describes locally known scripts."
::= { smScriptObjects 1 }
smScriptEntry OBJECT-TYPE
SYNTAX SmScriptEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
"An entry describing a particular script. Every script that
is stored in non-volatile memory is required to appear in
this script table."
INDEX { smScriptOwner, smScriptName }
::= { smScriptTable 1 }
SmScriptEntry ::= SEQUENCE {
smScriptOwner SnmpAdminString,
smScriptName SnmpAdminString,
smScriptDescr SnmpAdminString,
smScriptLanguage Integer32,
smScriptSource DisplayString,
smScriptAdminStatus INTEGER,
smScriptOperStatus INTEGER,
smScriptStorageType StorageType,
smScriptRowStatus RowStatus,
smScriptError SnmpAdminString,
smScriptLastChange DateAndTime
}
smScriptOwner OBJECT-TYPE
SYNTAX SnmpAdminString (SIZE (0..32))
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
"The manager who owns this row in the smScriptTable."
::= { smScriptEntry 1 }
smScriptName OBJECT-TYPE
SYNTAX SnmpAdminString (SIZE (1..32))
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
"The locally-unique, administratively assigned name for this
script. This object allows an smScriptOwner to have multiple
entries in the smScriptTable.
This value of this object may be used to derive the name
(e.g. a file name) which is used by the Script MIB
implementation to access the script in non-volatile
storage. The details of this mapping are implementation
specific. However, the mapping needs to ensure that scripts
created by different owners with the same script name do not
map to the same name in non-volatile storage."
::= { smScriptEntry 2 }
smScriptDescr OBJECT-TYPE
SYNTAX SnmpAdminString
MAX-ACCESS read-create
STATUS current
DESCRIPTION
"A description of the purpose of the script."
::= { smScriptEntry 3 }
smScriptLanguage OBJECT-TYPE
SYNTAX Integer32 (0..2147483647)
MAX-ACCESS read-create
STATUS current
DESCRIPTION
"The value of this object type identifies an entry in the
smLangTable which is used to execute this script.
The special value 0 may be used by hard-wired scripts
that can not be modified and that are executed by
internal functions.
Set requests to change this object are invalid if the
value of smScriptOperStatus is `enabled' or `compiling'
and will result in an inconsistentValue error.
Note that the data type and the range of this object must
be consistent with the definition of smLangIndex."
::= { smScriptEntry 4 }
smScriptSource OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS read-create
STATUS current
DESCRIPTION
"This object either contains a reference to the script
source or an empty string. A reference must be given
in the form of a Uniform Resource Locator (URL) as
defined in RFC 2396. The allowed character sets and the
encoding rules defined in RFC 2396 section 2 apply.
When the smScriptAdminStatus object is set to `enabled',
the Script MIB implementation will `pull' the script
source from the URL contained in this object if the URL
is not empty.
An empty URL indicates that the script source is loaded
from local storage. The script is read from the smCodeTable
if the value of smScriptStorageType is volatile. Otherwise,
the script is read from non-volatile storage.
Note: This document does not mandate implementation of any
specific URL scheme. An attempt to load a script from a
nonsupported URL scheme will cause the smScriptOperStatus
to report an `unknownProtocol' error.
Set requests to change this object are invalid if the
value of smScriptOperStatus is `enabled', `editing',
`retrieving' or `compiling' and will result in an
inconsistentValue error."
DEFVAL { ''H }
::= { smScriptEntry 5 }
smScriptAdminStatus OBJECT-TYPE
SYNTAX INTEGER {
enabled(1),
disabled(2),
editing(3)
}
MAX-ACCESS read-create
STATUS current
DESCRIPTION
"The value of this object indicates the desired status of
the script. See the definition of smScriptOperStatus for
a description of the values.
When the smScriptAdminStatus object is set to `enabled' and
the smScriptOperStatus is `disabled' or one of the error
states, the Script MIB implementation will `pull' the script
source from the URL contained in the smScriptSource object
if the URL is not empty."
DEFVAL { disabled }
::= { smScriptEntry 6 }
smScriptOperStatus OBJECT-TYPE
SYNTAX INTEGER {
enabled(1),
disabled(2),
editing(3),
retrieving(4),
compiling(5),
noSuchScript(6),
accessDenied(7),
wrongLanguage(8),
wrongVersion(9),
compilationFailed(10),
noResourcesLeft(11),
unknownProtocol(12),
protocolFailure(13),
genericError(14)
}
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"The actual status of the script in the runtime system. The
value of this object is only meaningful when the value of
the smScriptRowStatus object is `active'.
The smScriptOperStatus object may have the following values:
- `enabled' indicates that the script is available and can
be started by a launch table entry.
- `disabled' indicates that the script can not be used.
- `editing' indicates that the script can be modified in the
smCodeTable.
- `retrieving' indicates that the script is currently being
loaded from non-volatile storage or a remote system.
- `compiling' indicates that the script is currently being
compiled by the runtime system.
- `noSuchScript' indicates that the script does not exist
at the smScriptSource.
- `accessDenied' indicates that the script can not be loaded
from the smScriptSource due to a lack of permissions.
- `wrongLanguage' indicates that the script can not be
loaded from the smScriptSource because of a language
mismatch.
- `wrongVersion' indicates that the script can not be loaded
from the smScriptSource because of a language version
mismatch.
- `compilationFailed' indicates that the compilation failed.
- `noResourcesLeft' indicates that the runtime system does
not have enough resources to load the script.
- `unknownProtocol' indicates that the script could not be
loaded from the smScriptSource because the requested
protocol is not supported.
- `protocolFailure' indicates that the script could not be
loaded from the smScriptSource because of a protocol
failure.
- `genericError' indicates that the script could not be
loaded due to an error condition not listed above.
The `retrieving' and `compiling' states are transient states
which will either lead to one of the error states or the
`enabled' state. The `disabled' and `editing' states are
administrative states which are only reached by explicit
management operations.
All launch table entries that refer to this script table
entry shall have an smLaunchOperStatus value of `disabled'
when the value of this object is not `enabled'."
DEFVAL { disabled }
::= { smScriptEntry 7 }
smScriptStorageType OBJECT-TYPE
SYNTAX StorageType
MAX-ACCESS read-create
STATUS current
DESCRIPTION
"This object defines whether this row and the script
controlled by this row are kept in volatile storage and
lost upon reboot or if this row is backed up by
non-volatile or permanent storage.
The storage type of this row always complies with the value
of this entry if the value of the corresponding RowStatus
object is `active'.
However, the storage type of the script controlled by this
row may be different, if the value of this entry is
`non-volatile'. The script controlled by this row is written
into local non-volatile storage if the following condition
becomes true:
(a) the URL contained in the smScriptSource object is empty
and
(b) the smScriptStorageType is `nonVolatile'
and
(c) the smScriptOperStatus is `enabled'
Setting this object to `volatile' removes a script from
non-volatile storage if the script controlled by this row
has been in non-volatile storage before. Attempts to set
this object to permanent will always fail with an
inconsistentValue error.
The value of smScriptStorageType is only meaningful if the
value of the corresponding RowStatus object is `active'.
If smScriptStorageType has the value permanent(4), then all
objects whose MAX-ACCESS value is read-create must be
writable, with the exception of the smScriptStorageType and
smScriptRowStatus objects, which shall be read-only."
DEFVAL { volatile }
::= { smScriptEntry 8 }
smScriptRowStatus OBJECT-TYPE
SYNTAX RowStatus
MAX-ACCESS read-create
STATUS current
DESCRIPTION
"A control that allows entries to be added and removed from
this table.
Changing the smScriptRowStatus from `active' to
`notInService' will remove the associated script from the
runtime system.
Deleting conceptual rows from this table may affect the
deletion of other resources associated with this row. For
example, a script stored in non-volatile storage may be
removed from non-volatile storage.
An entry may not exist in the `active' state unless all
required objects in the entry have appropriate values. Rows
that are not complete or not in service are not known by the
script runtime system.
Attempts to `destroy' a row or to set a row `notInService'
while the smScriptOperStatus is `enabled' will result in an
inconsistentValue error."
okay so this part is basically the MIB getting into the nitty-gritty of how scripts get stored and launched π let's go π§
Attempts to `destroy' a row or to set a row `notInService'
where the value of the smScriptStorageType object is
`permanent' or `readOnly' will result in an
inconsistentValue error.
The value of this object has no effect on whether other
objects in this conceptual row can be modified."
::= { smScriptEntry 9 }
smScriptError OBJECT-TYPE
SYNTAX SnmpAdminString
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"This object contains a descriptive error message if the
transition into the operational status `enabled' failed.
Implementations must reset the error message to a
zero-length string when a new attempt to change the
script status to `enabled' is started."
DEFVAL { ''H }
::= { smScriptEntry 10 }
smScriptLastChange OBJECT-TYPE
SYNTAX DateAndTime
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"The date and time when this script table entry was last
modified. The value '0000000000000000'H is returned if
the script table entry has not yet been modified.
Note that the resetting of smScriptError is not considered
a change of the script table entry."
DEFVAL { '0000000000000000'H }
::= { smScriptEntry 11 }
ngl the smScriptError vibe is so dramatic π it's giving "clear your mistakes before trying again" energy, and the smScriptLastChange note is literally a plot twist: clearing the error doesn't count as a change π
--
-- Access to script code via SNMP
--
-- The smCodeTable allows script code to be read and modified
-- via SNMP.
--
smCodeTable OBJECT-TYPE
SYNTAX SEQUENCE OF SmCodeEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
"This table contains the script code for scripts that are
written via SNMP write operations."
::= { smScriptObjects 2 }
smCodeEntry OBJECT-TYPE
SYNTAX SmCodeEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
"An entry describing a particular fragment of a script."
INDEX { smScriptOwner, smScriptName, smCodeIndex }
::= { smCodeTable 1 }
SmCodeEntry ::= SEQUENCE {
smCodeIndex Unsigned32,
smCodeText OCTET STRING,
smCodeRowStatus RowStatus
}
smCodeIndex OBJECT-TYPE
SYNTAX Unsigned32 (1..4294967295)
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
"The index value identifying this code fragment."
::= { smCodeEntry 1 }
smCodeText OBJECT-TYPE
SYNTAX OCTET STRING (SIZE (1..1024))
MAX-ACCESS read-create
STATUS current
DESCRIPTION
"The code that makes up a fragment of a script. The format
of this code fragment depends on the script language which
is identified by the associated smScriptLanguage object."
::= { smCodeEntry 2 }
smCodeRowStatus OBJECT-TYPE
SYNTAX RowStatus
MAX-ACCESS read-create
STATUS current
DESCRIPTION
"A control that allows entries to be added and removed from
this table.
The value of this object has no effect on whether other
objects in this conceptual row can be modified."
::= { smCodeEntry 3 }
so this is the code table, aka where the script bits live when you write them over SNMP π¦ each fragment is its own little row, and the language decides how the code is read πΈ
--
-- Script execution.
--
-- This group defines tables which allow script execution to be
-- initiated, suspended, resumed, and terminated. It also provides
-- a mechanism for keeping a history of recent script executions
-- and their results.
--
smRunObjects OBJECT IDENTIFIER ::= { smObjects 4 }
smLaunchTable OBJECT-TYPE
SYNTAX SEQUENCE OF SmLaunchEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
"This table lists and describes scripts that are ready
to be executed together with their parameters."
::= { smRunObjects 1 }
smLaunchEntry OBJECT-TYPE
SYNTAX SmLaunchEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
"An entry describing a particular executable script."
INDEX { smLaunchOwner, smLaunchName }
::= { smLaunchTable 1 }
SmLaunchEntry ::= SEQUENCE {
smLaunchOwner SnmpAdminString,
smLaunchName SnmpAdminString,
smLaunchScriptOwner SnmpAdminString,
smLaunchScriptName SnmpAdminString,
smLaunchArgument OCTET STRING,
smLaunchMaxRunning Unsigned32,
smLaunchMaxCompleted Unsigned32,
smLaunchLifeTime TimeInterval,
smLaunchExpireTime TimeInterval,
smLaunchStart Integer32,
smLaunchControl INTEGER,
smLaunchAdminStatus INTEGER,
smLaunchOperStatus INTEGER,
smLaunchRunIndexNext Integer32,
smLaunchStorageType StorageType,
smLaunchRowStatus RowStatus,
smLaunchError SnmpAdminString,
smLaunchLastChange DateAndTime,
smLaunchRowExpireTime TimeInterval
}
the run group is where the action is, bestie π the launch table is basically the menu of scripts that are ready to go, with all their settings, and I'm obsessed with how it's split up π
smLaunchOwner OBJECT-TYPE
SYNTAX SnmpAdminString (SIZE (0..32))
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
"The manager who owns this row in the smLaunchTable. Every
instance of a running script started from a particular entry
in the smLaunchTable (i.e. entries in the smRunTable) will
be owned by the same smLaunchOwner used to index the entry
in the smLaunchTable. This owner is not necessarily the same
as the owner of the script itself (smLaunchScriptOwner)."
::= { smLaunchEntry 1 }
smLaunchName OBJECT-TYPE
SYNTAX SnmpAdminString (SIZE (1..32))
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
"The locally-unique, administratively assigned name for this
launch table entry. This object allows an smLaunchOwner to
have multiple entries in the smLaunchTable. The smLaunchName
is an arbitrary name that must be different from any other
smLaunchTable entries with the same smLaunchOwner but can be
the same as other entries in the smLaunchTable with
different smLaunchOwner values. Note that the value of
smLaunchName is not related in any way to the name of the
script being launched."
::= { smLaunchEntry 2 }
smLaunchScriptOwner OBJECT-TYPE
SYNTAX SnmpAdminString (SIZE (0..32))
MAX-ACCESS read-create
STATUS current
DESCRIPTION
"The value of this object in combination with the value of
smLaunchScriptName identifies the script that can be
launched from this smLaunchTable entry. Attempts to write
this object will fail with an inconsistentValue error if
the value of smLaunchOperStatus is `enabled'."
::= { smLaunchEntry 3 }
smLaunchScriptName OBJECT-TYPE
SYNTAX SnmpAdminString (SIZE (0..32))
MAX-ACCESS read-create
STATUS current
DESCRIPTION
"The value of this object in combination with the value of
the smLaunchScriptOwner identifies the script that can be
launched from this smLaunchTable entry. The zero-length
string may be used to point to a non-existing script.
Attempts to write this object will fail with an
inconsistentValue error if the value of smLaunchOperStatus
is `enabled'."
DEFVAL { ''H }
::= { smLaunchEntry 4 }
smLaunchArgument OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-create
STATUS current
DESCRIPTION
"The argument supplied to the script. When a script is
invoked, the value of this object is used to initialize
the smRunArgument object."
DEFVAL { ''H }
::= { smLaunchEntry 5 }
smLaunchMaxRunning OBJECT-TYPE
SYNTAX Unsigned32 (1..4294967295)
MAX-ACCESS read-create
STATUS current
DESCRIPTION
"The maximum number of concurrently running scripts that may
be invoked from this entry in the smLaunchTable. Lowering
the current value of this object does not affect any scripts
that are already executing."
DEFVAL { 1 }
::= { smLaunchEntry 6 }
smLaunchMaxCompleted OBJECT-TYPE
SYNTAX Unsigned32 (1..4294967295)
MAX-ACCESS read-create
STATUS current
DESCRIPTION
"The maximum number of finished scripts invoked from this
entry in the smLaunchTable allowed to be retained in the
smRunTable. Whenever the value of this object is changed
and whenever a script terminates, entries in the smRunTable
are deleted if necessary until the number of completed
scripts is smaller than the value of this object. Scripts
whose smRunEndTime value indicates the oldest completion
time are deleted first."
DEFVAL { 1 }
::= { smLaunchEntry 7 }
smLaunchLifeTime OBJECT-TYPE
SYNTAX TimeInterval
UNITS "centi-seconds"
MAX-ACCESS read-create
STATUS current
DESCRIPTION
"The default maximum amount of time a script launched
from this entry may run. The value of this object is used
to initialize the smRunLifeTime object when a script is
launched. Changing the value of an smLaunchLifeTime
instance does not affect scripts previously launched from
this entry."
DEFVAL { 360000 }
::= { smLaunchEntry 8 }
smLaunchExpireTime OBJECT-TYPE
SYNTAX TimeInterval
UNITS "centi-seconds"
MAX-ACCESS read-create
STATUS current
DESCRIPTION
"The default maximum amount of time information about a
script launched from this entry is kept in the smRunTable
after the script has completed execution. The value of
this object is used to initialize the smRunExpireTime
object when a script is launched. Changing the value of an
smLaunchExpireTime instance does not affect scripts
previously launched from this entry."
DEFVAL { 360000 }
::= { smLaunchEntry 9 }
smLaunchStart OBJECT-TYPE
SYNTAX Integer32 (0..2147483647)
MAX-ACCESS read-create
STATUS current
DESCRIPTION
"This object is used to start the execution of scripts.
When retrieved, the value will be the value of smRunIndex
for the last script that started execution by manipulating
this object. The value will be zero if no script started
execution yet.
A script is started by setting this object to an unused
smRunIndex value. A new row in the smRunTable will be
created which is indexed by the value supplied by the
set-request in addition to the value of smLaunchOwner and
smLaunchName. An unused value can be obtained by reading
the smLaunchRunIndexNext object.
Setting this object to the special value 0 will start
the script with a self-generated smRunIndex value. The
consequence is that the script invoker has no reliable
way to determine the smRunIndex value for this script
invocation and that the invoker has therefore no way
to obtain the results from this script invocation. The
special value 0 is however useful for scheduled script
invocations.
the smLaunchStart object is the big red button π₯ start a run by setting it to an unused index, grab a fresh one from smLaunchRunIndexNext, and beware the magic value 0, which is great for scheduled runs but leaves you with no reliable way to find your results π
okay so we're picking up right where the smLaunchStart checks left off π β¨ this is the part that decides whether a script gets to launch at all, so let's go π
If this object is set, the following checks must be
performed:
1) The value of the smLaunchOperStatus object in this
entry of the smLaunchTable must be `enabled'.
2) The values of smLaunchScriptOwner and
smLaunchScriptName of this row must identify an
existing entry in the smScriptTable.
3) The value of smScriptOperStatus of this entry must
be `enabled'.
4) The principal performing the set operation must have
read access to the script. This must be checked by
calling the isAccessAllowed abstract service interface
defined in RFC 2271 on the row in the smScriptTable
identified by smLaunchScriptOwner and smLaunchScriptName.
The isAccessAllowed abstract service interface must be
called on all columnar objects in the smScriptTable with
a MAX-ACCESS value different than `not-accessible'. The
test fails as soon as a call indicates that access is
not allowed.
5) If the value provided by the set operation is not 0,
a check must be made that the value is currently not
in use. Otherwise, if the value provided by the set
operation is 0, a suitable unused value must be
generated.
6) The number of currently executing scripts invoked
from this smLaunchTable entry must be less than
smLaunchMaxRunning.
Attempts to start a script will fail with an
inconsistentValue error if one of the checks described
above fails.
Otherwise, if all checks have been passed, a new entry
in the smRunTable will be created indexed by smLaunchOwner,
smLaunchName and the new value for smRunIndex. The value
of smLaunchArgument will be copied into smRunArgument,
the value of smLaunchLifeTime will be copied to
smRunLifeTime, and the value of smLaunchExpireTime
will be copied to smRunExpireTime.
The smRunStartTime will be set to the current time and
the smRunState will be set to `initializing' before the
script execution is initiated in the appropriate runtime
system.
Note that the data type and the range of this object must
be consistent with the smRunIndex object. Since this
object might be written from the scheduling MIB, the
data type Integer32 rather than Unsigned32 is used."
DEFVAL { 0 }
::= { smLaunchEntry 10 }
smLaunchControl OBJECT-TYPE
SYNTAX INTEGER {
abort(1),
suspend(2),
resume(3),
nop(4)
}
MAX-ACCESS read-create
STATUS current
DESCRIPTION
"This object is used to request a state change for all
running scripts in the smRunTable that were started from
this row in the smLaunchTable.
Setting this object to abort(1), suspend(2) or resume(3)
will set the smRunControl object of all applicable rows
in the smRunTable to abort(1), suspend(2) or resume(3)
respectively. The phrase `applicable rows' means the set of
rows which were created from this entry in the smLaunchTable
and whose value of smRunState allows the corresponding
state change as described in the definition of the
smRunControl object. Setting this object to nop(4) has no
effect.
Attempts to set this object lead to an inconsistentValue
error only if all implicated sets on all the applicable
rows lead to inconsistentValue errors. It is not allowed
to return an inconsistentValue error if at least one state
change on one of the applicable rows was successful."
DEFVAL { nop }
::= { smLaunchEntry 11 }
smLaunchAdminStatus OBJECT-TYPE
SYNTAX INTEGER {
enabled(1),
disabled(2),
autostart(3)
}
MAX-ACCESS read-create
STATUS current
DESCRIPTION
"The value of this object indicates the desired status of
this launch table entry. The values enabled(1) and
autostart(3) both indicate that the launch table entry
should transition into the operational enabled(1) state as
soon as the associated script table entry is enabled(1).
The value autostart(3) further indicates that the script
is started automatically by conceptually writing the
value 0 into the associated smLaunchStart object during
the transition from the `disabled' into the `enabled'
operational state. This is useful for scripts that are
to be launched on system start-up."
DEFVAL { disabled }
::= { smLaunchEntry 12 }
smLaunchOperStatus OBJECT-TYPE
SYNTAX INTEGER {
enabled(1),
disabled(2),
expired(3)
}
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"The value of this object indicates the actual status of
this launch table entry. The smLaunchOperStatus object
may have the following values:
- `enabled' indicates that the launch table entry is
available and can be used to start scripts.
- `disabled' indicates that the launch table entry can
not be used to start scripts.
- `expired' indicates that the launch table entry can
not be used to start scripts and will disappear as
soon as all smRunTable entries associated with this
launch table entry have disappeared.
The value `enabled' requires that the smLaunchRowStatus
object is active. The value `disabled' requires that there
are no entries in the smRunTable associated with this
smLaunchTable entry."
DEFVAL { disabled }
::= { smLaunchEntry 13 }
smLaunchRunIndexNext OBJECT-TYPE
SYNTAX Integer32 (1..2147483647)
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"This variable is used for creating rows in the smRunTable.
The value of this variable is a currently unused value
for smRunIndex, which can be written into the smLaunchStart
object associated with this row to launch a script.
The value returned when reading this variable must be unique
for the smLaunchOwner and smLaunchName associated with this
row. Subsequent attempts to read this variable must return
different values.
This variable will return the special value 0 if no new rows
can be created.
Note that the data type and the range of this object must be
consistent with the definition of smRunIndex."
::= { smLaunchEntry 14 }
smLaunchStorageType OBJECT-TYPE
SYNTAX StorageType
MAX-ACCESS read-create
STATUS current
DESCRIPTION
"This object defines if this row is kept in volatile storage
and lost upon reboot or if this row is backed up by stable
storage.
The value of smLaunchStorageType is only meaningful if the
value of the corresponding RowStatus object is active.
If smLaunchStorageType has the value permanent(4), then all
objects whose MAX-ACCESS value is read-create must be
writable, with the exception of the smLaunchStorageType and
smLaunchRowStatus objects, which shall be read-only."
DEFVAL { volatile }
::= { smLaunchEntry 15 }
smLaunchRowStatus OBJECT-TYPE
SYNTAX RowStatus
MAX-ACCESS read-create
STATUS current
DESCRIPTION
"A control that allows entries to be added and removed from
this table.
Attempts to `destroy' a row or to set a row `notInService'
while the smLaunchOperStatus is `enabled' will result in
an inconsistentValue error.
Attempts to `destroy' a row or to set a row `notInService'
where the value of the smLaunchStorageType object is
`permanent' or `readOnly' will result in an
inconsistentValue error.
The value of this object has no effect on whether other
objects in this conceptual row can be modified."
::= { smLaunchEntry 16 }
smLaunchError OBJECT-TYPE
SYNTAX SnmpAdminString
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"This object contains a descriptive error message if an
attempt to launch a script fails. Implementations must reset
the error message to a zero-length string when a new attempt
to launch a script is started."
DEFVAL { ''H }
::= { smLaunchEntry 17 }
smLaunchLastChange OBJECT-TYPE
SYNTAX DateAndTime
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"The date and time when this launch table entry was last
modified. The value '0000000000000000'H is returned if
the launch table entry has not yet been modified.
Note that a change of smLaunchStart, smLaunchControl,
smLaunchRunIndexNext, smLaunchRowExpireTime, or the
resetting of smLaunchError is not considered a change
of this launch table entry."
DEFVAL { '0000000000000000'H }
::= { smLaunchEntry 18 }
smLaunchRowExpireTime OBJECT-TYPE
SYNTAX TimeInterval
UNITS "centi-seconds"
MAX-ACCESS read-create
STATUS current
DESCRIPTION
"The value of this object specifies how long this row remains
in the `enabled' or `disabled' operational state. The value
reported by this object ticks backwards. When the value
reaches 0, it stops ticking backward and the row is
deleted if there are no smRunTable entries associated with
this smLaunchTable entry. Otherwise, the smLaunchOperStatus
changes to `expired' and the row deletion is deferred
until there are no smRunTable entries associated with this
smLaunchTable entry.
The smLaunchRowExpireTime will not tick backwards if it is
set to its maximum value (2147483647). In other words,
setting this object to its maximum value turns the timer
off.
The value of this object may be set in order to increase
or reduce the remaining time that the launch table entry
may be used. Setting the value to 0 will cause an immediate
row deletion or transition into the `expired' operational
state.
It is not possible to set this object while the operational
status is `expired'. Attempts to modify this object while
the operational status is `expired' leads to an
inconsistentValue error.
Note that the timer ticks backwards independent of the
operational state of the launch table entry."
DEFVAL { 2147483647 }
::= { smLaunchEntry 19 }
that's the end of the launch table block for now πΈ the checks, the control object, the admin and oper status, the run index, storage, row status, error, last change and expire time are all in there, exactly as written π
smRunTable OBJECT-TYPE SYNTAX SEQUENCE OF SmRunEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "This table lists and describes scripts that are currently running or have been running in the past." ::= { smRunObjects 2 }
smRunEntry OBJECT-TYPE SYNTAX SmRunEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "An entry describing a particular running or finished script." INDEX { smLaunchOwner, smLaunchName, smRunIndex } ::= { smRunTable 1 }
SmRunEntry ::= SEQUENCE { smRunIndex Integer32, smRunArgument OCTET STRING, smRunStartTime DateAndTime, smRunEndTime DateAndTime, smRunLifeTime TimeInterval, smRunExpireTime TimeInterval, smRunExitCode INTEGER, smRunResult OCTET STRING, smRunControl INTEGER, smRunState INTEGER, smRunError SnmpAdminString, smRunResultTime DateAndTime, smRunErrorTime DateAndTime }
smRunIndex OBJECT-TYPE SYNTAX Integer32 (1..2147483647) MAX-ACCESS not-accessible STATUS current DESCRIPTION "The locally arbitrary, but unique identifier associated with this running or finished script. This value must be unique for all rows in the smRunTable with the same smLaunchOwner and smLaunchName.
Note that the data type and the range of this object must be consistent with the definition of smLaunchRunIndexNext and smLaunchStart." ::= { smRunEntry 1 }
smRunArgument OBJECT-TYPE SYNTAX OCTET STRING MAX-ACCESS read-only STATUS current DESCRIPTION "The argument supplied to the script when it started." DEFVAL { ''H } ::= { smRunEntry 2 }
smRunStartTime OBJECT-TYPE SYNTAX DateAndTime MAX-ACCESS read-only STATUS current DESCRIPTION "The date and time when the execution started. The value '0000000000000000'H is returned if the script has not started yet." DEFVAL { '0000000000000000'H } ::= { smRunEntry 3 }
smRunEndTime OBJECT-TYPE SYNTAX DateAndTime MAX-ACCESS read-only STATUS current DESCRIPTION "The date and time when the execution terminated. The value '0000000000000000'H is returned if the script has not terminated yet." DEFVAL { '0000000000000000'H } ::= { smRunEntry 4 }
smRunLifeTime OBJECT-TYPE SYNTAX TimeInterval UNITS "centi-seconds" MAX-ACCESS read-write STATUS current DESCRIPTION "This object specifies how long the script can execute. This object returns the remaining time that the script may run. The object is initialized with the value of the associated smLaunchLifeTime object and ticks backwards. The script is aborted immediately when the value reaches 0.
The value of this object may be set in order to increase or reduce the remaining time that the script may run. Setting this value to 0 will abort script execution immediately, and, if the value of smRunExpireTime is also 0, will remove this entry from the smRunTable once it has terminated.
If smRunLifeTime is set to its maximum value (2147483647), either by a set operation or by its initialization from the smLaunchLifeTime object, then it will not tick backwards. A running script with a maximum smRunLifeTime value will thus never be terminated with a `lifeTimeExceeded' exit code.
The value of smRunLifeTime reflects the real-time execution time as seen by the outside world. The value of this object will always be 0 for a script that finished execution, that is smRunState has the value `terminated'.
The value of smRunLifeTime does not change while a script is suspended, that is smRunState has the value `suspended'. Note that this does not affect set operations. It is legal to modify smRunLifeTime via set operations while a script is suspended." ::= { smRunEntry 5 }
smRunExpireTime OBJECT-TYPE SYNTAX TimeInterval UNITS "centi-seconds" MAX-ACCESS read-write STATUS current DESCRIPTION "The value of this object specifies how long this row can exist in the smRunTable after the script has terminated. This object returns the remaining time that the row may exist before it is aged out. The object is initialized with the value of the associated smLaunchExpireTime object and ticks backwards. The entry in the smRunTable is destroyed when the value reaches 0 and the smRunState has the value `terminated'.
The value of this object may be set in order to increase or reduce the remaining time that the row may exist. Setting the value to 0 will destroy this entry as soon as the smRunState has the value `terminated'." ::= { smRunEntry 6 }
smRunExitCode OBJECT-TYPE SYNTAX INTEGER { noError(1), halted(2), lifeTimeExceeded(3), noResourcesLeft(4), languageError(5), runtimeError(6), invalidArgument(7), securityViolation(8), genericError(9) } MAX-ACCESS read-only STATUS current DESCRIPTION "The value of this object indicates the reason why a script finished execution. The smRunExitCode code may have one of the following values:
- `noError', which indicates that the script completed successfully without errors;
- `halted', which indicates that the script was halted by a request from an authorized manager;
- `lifeTimeExceeded', which indicates that the script exited because a time limit was exceeded;
- `noResourcesLeft', which indicates that the script exited because it ran out of resources (e.g. memory);
- `languageError', which indicates that the script exited because of a language error (e.g. a syntax error in an interpreted language);
- `runtimeError', which indicates that the script exited due to a runtime error (e.g. a division by zero);
- `invalidArgument', which indicates that the script could not be run because of invalid script arguments;
- `securityViolation', which indicates that the script exited due to a security violation;
- `genericError', which indicates that the script exited for an unspecified reason.
If the script has not yet begun running, or is currently running, the value will be `noError'." DEFVAL { noError } ::= { smRunEntry 7 }
smRunResult OBJECT-TYPE SYNTAX OCTET STRING MAX-ACCESS read-only STATUS current DESCRIPTION "The result value produced by the running script. Note that the result may change while the script is executing." DEFVAL { ''H } ::= { smRunEntry 8 }
smRunControl OBJECT-TYPE SYNTAX INTEGER { abort(1), suspend(2), resume(3), nop(4) } MAX-ACCESS read-write STATUS current DESCRIPTION "The value of this object indicates the desired status of the script execution defined by this row.
Setting this object to abort' will abort execution if the value of smRunState is initializing', executing', suspending', suspended' or resuming'. Setting this object to abort' when the value of smRunState is aborting' or `terminated', or if the implementation can determine that the attempt to abort the execution would fail, will result in an inconsistentValue error.
Setting this object to suspend' will suspend execution if the value of smRunState is executing'. Setting this object to suspend' will cause an inconsistentValue error if the value of smRunState is not executing' or if the implementation can determine that the attempt to suspend the execution would fail.
Setting this object to resume' will resume execution if the value of smRunState is suspending' or suspended'. Setting this object to resume' will cause an inconsistentValue error if the value of smRunState is not `suspended' or if the implementation can determine that the attempt to resume the execution would fail.
Setting this object to nop(4) has no effect." DEFVAL { nop } ::= { smRunEntry 9 }
smRunState OBJECT-TYPE SYNTAX INTEGER { initializing(1), executing(2), suspending(3), suspended(4), resuming(5), aborting(6), terminated(7) } MAX-ACCESS read-only STATUS current DESCRIPTION "The value of this object indicates the script's execution state. If the script has been invoked but has not yet begun execution, the value will be initializing'. If the script is running, the value will be executing'.
A running script which received a request to suspend execution first transitions into a temporary suspending' state. The temporary suspending' state changes to suspended' when the script has actually been suspended. The temporary suspending' state changes back to `executing' if the attempt to suspend the running script fails.
A suspended script which received a request to resume execution first transitions into a temporary resuming' state. The temporary resuming' state changes to running' when the script has actually been resumed. The temporary resuming' state changes back to `suspended' if the attempt to resume the suspended script fails.
A script which received a request to abort execution but which is still running first transitions into a temporary `aborting' state.
A script which has finished its execution is `terminated'." ::= { smRunEntry 10 }
smRunError OBJECT-TYPE SYNTAX SnmpAdminString MAX-ACCESS read-only STATUS current DESCRIPTION "This object contains a descriptive error message if the script startup or execution raised an abnormal condition. An implementation must store a descriptive error message in this object if the script exits with the smRunExitCode `genericError'." DEFVAL { ''H } ::= { smRunEntry 11 }
smRunResultTime OBJECT-TYPE
SYNTAX DateAndTime
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"The date and time when the smRunResult was last updated.
The value '0000000000000000'H is returned if smRunResult
has not yet been updated after the creation of this
smRunTable entry."
DEFVAL { '0000000000000000'H }
::= { smRunEntry 12 }
smRunErrorTime OBJECT-TYPE
SYNTAX DateAndTime
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"The date and time when the smRunError was last updated.
The value '0000000000000000'H is returned if smRunError
has not yet been updated after the creation of this
smRunTable entry."
DEFVAL { '0000000000000000'H }
::= { smRunEntry 13 }
--
-- Notifications. The definition of smTraps makes notification
-- registrations reversible (see STD 58, RFC 2578).
--
smTraps OBJECT IDENTIFIER ::= { smNotifications 0 }
smScriptAbort NOTIFICATION-TYPE
OBJECTS { smRunExitCode, smRunEndTime, smRunError }
STATUS current
DESCRIPTION
"This notification is generated whenever a running script
terminates with an smRunExitCode unequal to `noError'."
::= { smTraps 1 }
smScriptResult NOTIFICATION-TYPE
OBJECTS { smRunResult }
STATUS current
DESCRIPTION
"This notification can be used by scripts to notify other
management applications about results produced by the
script.
This notification is not automatically generated by the
Script MIB implementation. It is the responsibility of
the executing script to emit this notification where it
is appropriate to do so."
::= { smTraps 2 }
smScriptException NOTIFICATION-TYPE
OBJECTS { smRunError }
STATUS current
DESCRIPTION
"This notification can be used by scripts to notify other
management applications about script errors.
This notification is not automatically generated by the
Script MIB implementation. It is the responsibility of
the executing script or the runtime system to emit this
notification where it is appropriate to do so."
::= { smTraps 3 }
-- conformance information
smCompliances OBJECT IDENTIFIER ::= { smConformance 1 }
smGroups OBJECT IDENTIFIER ::= { smConformance 2 }
-- compliance statements
smCompliance2 MODULE-COMPLIANCE
STATUS current
DESCRIPTION
"The compliance statement for SNMP entities which implement
the Script MIB."
MODULE -- this module
MANDATORY-GROUPS {
smLanguageGroup, smScriptGroup2, smLaunchGroup2,
smRunGroup2, smNotificationsGroup2
}
GROUP smCodeGroup
DESCRIPTION
"The smCodeGroup is mandatory only for those implementations
that support the downloading of scripts via SNMP."
OBJECT smScriptSource
MIN-ACCESS read-only
DESCRIPTION
"The smScriptSource object is read-only for implementations
that are not able to download script code from a URL."
OBJECT smCodeText
DESCRIPTION
"A compliant implementation need only support write access to
the smCodeText object only during row creation."
OBJECT smLaunchArgument
DESCRIPTION
"A compliant implementation has to support a minimum size
for smLaunchArgument of 255 octets."
OBJECT smRunArgument
DESCRIPTION
"A compliant implementation has to support a minimum size
for smRunArgument of 255 octets."
OBJECT smRunResult
DESCRIPTION
"A compliant implementation has to support a minimum size
for smRunResult of 255 octets."
OBJECT smRunState
DESCRIPTION
"A compliant implementation does not have to support script
suspension and the smRunState `suspended'. Such an
implementation will change into the `suspending' state
when the smRunControl is set to `suspend' and remain in this
state until smRunControl is set to `resume' or the script
terminates."
::= { smCompliances 2 }
smLanguageGroup OBJECT-GROUP
OBJECTS {
smLangLanguage, smLangVersion,
smLangVendor, smLangRevision,
smLangDescr, smExtsnExtension,
smExtsnVersion, smExtsnVendor,
smExtsnRevision, smExtsnDescr
}
STATUS current
DESCRIPTION
"A collection of objects providing information about the
capabilities of the scripting engine."
::= { smGroups 1 }
smScriptGroup2 OBJECT-GROUP
OBJECTS {
smScriptDescr, smScriptLanguage,
smScriptSource, smScriptAdminStatus,
smScriptOperStatus, smScriptStorageType,
smScriptRowStatus, smScriptError,
smScriptLastChange
}
STATUS current
DESCRIPTION
"A collection of objects providing information about
installed scripts."
::= { smGroups 7 }
smCodeGroup OBJECT-GROUP
OBJECTS {
smCodeText, smCodeRowStatus
}
STATUS current
DESCRIPTION
"A collection of objects used to download or modify scripts
by using SNMP set requests."
::= { smGroups 3 }
smLaunchGroup2 OBJECT-GROUP
OBJECTS {
smLaunchScriptOwner, smLaunchScriptName,
smLaunchArgument, smLaunchMaxRunning,
smLaunchMaxCompleted, smLaunchLifeTime,
smLaunchExpireTime, smLaunchStart,
smLaunchControl, smLaunchAdminStatus,
smLaunchOperStatus, smLaunchRunIndexNext,
smLaunchStorageType, smLaunchRowStatus,
smLaunchError, smLaunchLastChange,
smLaunchRowExpireTime
}
STATUS current
DESCRIPTION
"A collection of objects providing information about scripts
that can be launched."
::= { smGroups 8 }
smRunGroup2 OBJECT-GROUP
OBJECTS {
smRunArgument, smRunStartTime,
smRunEndTime, smRunLifeTime,
smRunExpireTime, smRunExitCode,
smRunResult, smRunState,
smRunControl, smRunError,
smRunResultTime, smRunErrorTime
}
STATUS current
DESCRIPTION
"A collection of objects providing information about running
scripts."
::= { smGroups 9 }
smNotificationsGroup2 NOTIFICATION-GROUP
NOTIFICATIONS {
smScriptAbort,
smScriptResult,
smScriptException
}
STATUS current
DESCRIPTION
"The notifications emitted by the Script MIB."
::= { smGroups 10 }
--
-- Deprecated compliance and conformance group definitions
-- from RFC 2592.
--
smCompliance MODULE-COMPLIANCE
STATUS deprecated
DESCRIPTION
"The compliance statement for SNMP entities which implement
the Script MIB."
MODULE -- this module
MANDATORY-GROUPS {
smLanguageGroup, smScriptGroup, smLaunchGroup, smRunGroup
}
GROUP smCodeGroup
DESCRIPTION
"The smCodeGroup is mandatory only for those implementations
that support the downloading of scripts via SNMP."
OBJECT smScriptSource
MIN-ACCESS read-only
DESCRIPTION
"The smScriptSource object is read-only for implementations
that are not able to download script code from a URL."
OBJECT smCodeText
DESCRIPTION
"A compliant implementation need only support write access
to the smCodeText object during row creation."
OBJECT smLaunchArgument
DESCRIPTION
"A compliant implementation has to support a minimum size
for smLaunchArgument of 255 octets."
OBJECT smRunArgument
DESCRIPTION
"A compliant implementation has to support a minimum size
for smRunArgument of 255 octets."
OBJECT smRunResult
DESCRIPTION
"A compliant implementation has to support a minimum size
for smRunResult of 255 octets."
OBJECT smRunState
DESCRIPTION
"A compliant implementation does not have to support script
suspension and the smRunState `suspended'. Such an
implementation will change into the `suspending' state
when the smRunControl is set to `suspend' and remain in this
state until smRunControl is set to `resume' or the script
terminates."
::= { smCompliances 1 }
smScriptGroup OBJECT-GROUP
OBJECTS {
smScriptDescr, smScriptLanguage,
smScriptSource, smScriptAdminStatus,
smScriptOperStatus, smScriptStorageType,
smScriptRowStatus
}
STATUS deprecated
DESCRIPTION
"A collection of objects providing information about
installed scripts."
::= { smGroups 2 }
smLaunchGroup OBJECT-GROUP
OBJECTS {
smLaunchScriptOwner, smLaunchScriptName,
smLaunchArgument, smLaunchMaxRunning,
smLaunchMaxCompleted, smLaunchLifeTime,
smLaunchExpireTime, smLaunchStart,
smLaunchControl, smLaunchAdminStatus,
smLaunchOperStatus, smLaunchRunIndexNext,
smLaunchStorageType, smLaunchRowStatus
}
STATUS deprecated
DESCRIPTION
"A collection of objects providing information about scripts
that can be launched."
::= { smGroups 4 }
smRunGroup OBJECT-GROUP
OBJECTS {
smRunArgument, smRunStartTime,
smRunEndTime, smRunLifeTime,
smRunExpireTime, smRunExitCode,
smRunResult, smRunState,
smRunControl, smRunError
}
STATUS deprecated
DESCRIPTION
"A collection of objects providing information about running
scripts."
::= { smGroups 5 }
smNotificationsGroup NOTIFICATION-GROUP
NOTIFICATIONS {
smScriptAbort,
smScriptResult
}
STATUS deprecated
DESCRIPTION
"The notifications emitted by the Script MIB."
::= { smGroups 6 }
END
7. Usage Examples β¨
This section presents some examples that explain how a manager can use the Script MIB defined in this memo. The purpose of these examples is to explain the steps that are normally used to delegate management scripts. π
7.1. Pushing a Script via SNMP β¨
okay so this one is about how a manager pushes a script into a distributed manager π
- The manager first checks the smLangTable and the smExtsnTable so it can pick the right script or language π
- The manager creates a row in the smScriptTable by sending an SNMP set-request π The smScriptRowStatus object is set to
createAndWaitand the smScriptSource object is set to an empty string. The smScriptLanguage object is set to the language the script was written in. The smScriptStorageType object is set tovolatileto show that the script will be loaded through the smCodeTable. The smScriptOwner is set to a string that identifies the principal who owns the new row. The smScriptName defines the administratively assigned unique name for the script π·οΈ - The manager sets the smScriptRowStatus object to
activeand the smScriptAdminStatus object toeditingπ¦ - The manager pushes the script to the distributed manager by sending a couple of SNMP set-requests to fill the smCodeTable π¦
- Once the whole script has been transferred, the manager sends a set-request to set the smScriptAdminStatus object to
enabled. The Script MIB implementation now makes the script accessible to the runtime system. This might include compiling the script if the language needs a compilation step π₯ - The manager polls the smScriptOperStatus object until the value is either
enabledor one of the error status codes π The script can only be used if the value of smScriptOperStatus isenabledπ - If the manager wants to store the script in local non-volatile storage, it should send a set-request that changes the smScriptStorageType object to
nonVolatileπ«Ά
7.2. Pulling a Script from a URL π
this example is about how a manager gets a distributed manager to pull a script from a URL π§
- The manager first checks the smLangTable and the smExtsnTable so it can pick the right script or language π
- The manager creates a row in the smScriptTable by sending an SNMP set-request π The smScriptRowStatus object is set to
createAndWaitand the smScriptSource object is set to the URL that points to the script source. The smScriptLanguage object is set to the language the script was written in. The smScriptOwner is set to a string that identifies the principal who owns the new row. The smScriptName defines the administratively assigned unique name for the script π·οΈ - The manager sets the smScriptRowStatus object to
activeπ¦ - The manager sends a set-request to set the smScriptAdminStatus object to
enabled. The Script MIB implementation now makes the script accessible to the runtime system. This causes a retrieval operation to pull the script from the URL stored in smScriptSource. That retrieval might be followed by a compile operation if the language needs a compilation step π₯ - The manager polls the smScriptOperStatus object until the value is either
enabledor one of the error status codes π The script can only be used if the value of smScriptOperStatus isenabledπ - If the manager wants to store the script in local non-volatile storage, it should send a set-request that changes the smScriptStorageType object to
nonVolatileπ«Ά
7.3. Modifying an Existing Script π
this section is about how a manager can modify a script by sending SNMP set-requests βοΈ
- First, the script is de-activated by setting the smScriptAdminStatus to
disabledπ - The manager polls the smScriptOperStatus object until the value is
disabledπ - The manager sets smScriptSource to an empty string and smScriptAdminStatus to
editing. This makes the script source available in the smCodeTable π¦ - The manager polls the smScriptOperStatus object until the value is
editingπ - The manager sends SNMP set-requests to modify the script in the smCodeTable πͺ
- The manager sends a set-request to set the smScriptAdminStatus object to
enabled. The Script MIB implementation now makes the script accessible to the runtime system. This might include compiling the script if the language needs a compilation step π₯ - The manager polls the smScriptOperStatus object until the value is either
enabledor one of the error status codes π The script can only be used if the value of smScriptOperStatus isenabledπ
7.4. Removing an Existing Script ποΈ
this section is about how a manager can remove a script from a distributed manager π
- First, the manager sets the smScriptAdminStatus to
disabled. This makes sure no new scripts can start while running scripts finish their execution π - The manager polls the smScriptOperStatus object until the value is
disabledπ - The manager sends an SNMP set-request to change the smScriptRowStatus object to
destroy. This removes the row and all associated resources from the Script MIB implementation πβ¨
7.5. Creating a Launch Button π
this section is about how a manager can create a launch button for starting a script π
- The manager, who is identified by an smLaunchOwner value, first picks a name for the new row in the smLaunchTable. The manager sends an SNMP set-request to set the smLaunchRowStatus object for this smLaunchOwner and smLaunchName to
createAndWaitπ - The manager fills the new smLaunchTable row with all required parameters. The smLaunchScriptOwner and smLaunchScriptName values point to the script that should be started from this launch button π§©
- The manager sets the smLaunchRowStatus object to
activeπ¦ - The manager sends a set-request to change smLaunchAdminStatus to
enabledonce the new smLaunchTable row is complete π - The manager polls the smLaunchOperStatus object until the value is
enabledπ
7.6. Launching a Script π§ββοΈ
this section is about the suggested way to launch a script from a given launch button πΈ
- The manager first retrieves the value of smLaunchRunIndexNext from the launch button it selected to start the script π
- The manager sends an SNMP set-request to set the smLaunchStart object to the value obtained in step 1. This launches the script if all necessary pre-conditions are satisfied (see the definition of smLaunchStart for more details). The manager can also provide the smLaunchArgument in the same set-request that is used to start the script. When the start succeeds, a new row is created in the smRunTable, indexed by smLaunchOwner, smLaunchName and the value written to smLaunchStart π
- The manager polls the smRunState object until the value is either
executing(the default case),suspendedorterminatedπ
The first step is not required π A manager can also try to guess an unused value for smRunIndex if it wants to start the script in a single transaction. A manager can also use the special value 0 if it does not care about the smRunIndex π²
7.7. Suspending a Running Script βΈοΈ
this section is about how a manager can suspend a running script π«
- The manager sets the smRunControl object of the running script, or the smLaunchControl object of the launch button used to start the running script, to
suspend. Setting smLaunchControl suspends all running scripts started from that launch button, while smRunControl only suspends the running script associated with that smRunControl instance π - The manager polls the smRunState object until the value is either
suspended,executing, orterminated. If the value issuspended, the suspend operation worked β If the value isexecuting, the attempt to suspend the script failed π The valueterminatedcan come back when the suspend operation failed and the running script terminated between the polls π
Heads up: the set operation in the first step can lead to an inconsistentValue error. That means the suspend operation failed (for example, because the runtime system doesn't support suspend/resume). There's no need to poll smRunState in this case π
7.8. Resuming a Suspended Script βΆοΈ
this section is about how a manager can resume a suspended script π
- The manager sets the smRunControl object of the running script, or the smLaunchControl object of the launch button used to start the running script, to
resume. Setting smLaunchControl resumes all running scripts started from that launch button, while smRunControl only resumes the running script associated with that smRunControl instance π - The manager polls the smRunState object until the value is either
suspended,executing, orterminated. If the value isexecuting, the resume operation worked π₯³ If the value issuspended, the attempt to resume the script failed π© The valueterminatedcan come back when the resume operation was successful and the running script terminated between the polls π»
Heads up: the set operation in the first step can lead to an inconsistentValue error. That means the resume operation failed (for example, because the runtime system doesn't support suspend/resume). There's no need to poll smRunState in this case π
7.9. Terminating a Running Script π
this section explains two ways to terminate a running script π« The first approach goes like this:
- The manager sets the smRunControl object of the running script, or the smLaunchControl object of the launch button used to start the running script, to
abort. Setting smLaunchControl aborts all running scripts started from that launch button, while smRunControl only aborts the running script associated with that smRunControl instance 𧨠- The manager polls the smRunState object until the value is
terminatedπ
The second way to terminate a script is to set the smRunLifeTime to zero. That causes the runtime system to terminate the script with a lifeTimeExceeded exit code β°
- The manager changes the value of smRunLifeTime to 0. This causes the Script MIB implementation to abort the script, because the remaining life time has expired β
- The manager polls the smRunState object until the value is
terminatedπ
Changing the smRunLifeTime value can also be used to increase the permitted lifetime of a running script πΈ
For example, a manager can choose to set smRunLifeTime to a small fixed time interval and increase the value periodically. This strategy has the nice effect that scripts terminate automatically if the manager loses contact with the Script MIB engine π«Ά
7.10. Removing a Terminated Script π§Ή
this section is about how a manager can remove a terminated script π
- The manager changes the smRunExpireTime to 0. This causes the Script MIB implementation to destroy the smRunTable entry of the terminated script π β¨
7.11. Removing a Launch Button π§Ήβ¨
Okay so this section is all about how a manager can take a launch button away from a distributed manager. Bestie, the order matters here, so pay attention π
- First, the manager sets the
smLaunchAdminStatustodisabled. This makes sure no new scripts can start from this launch button while the running ones finish up π - The manager polls the
smLaunchOperStatusobject until the value isdisabledπ - The manager sends an SNMP set-request to change the
smLaunchRowStatusobject todestroy. This removes the row and all its associated resources from the Script MIB implementation, and it's gone for good ποΈπ
8. VACM Configuration Examples π
This section shows how the view-based access control model defined in RFC 2575 [RFC2575] can be configured to control access to the Script MIB. It's giving access control realness π€
8.1. Sandbox for Guests ποΈ
The first example shows how to set VACM up so the members of the VACM group "guest" get limited access to the Script MIB. The MIB views below give "guest" members their own little sandbox where they can install and start their own scripts, but they can't touch any other scripts the Script MIB implementation is maintaining. Very cute, very contained π
vacmAccessReadView."guest"."".usm.authNoPriv = "guestReadView"
vacmAccessWriteView."guest"."".usm.authNoPriv = "guestWriteView"
The guestReadView grants read access to the smLangTable, the smExtsnTable, and to all the table entries owned by "guest" π
guestReadView:
smLangTable (included)
smExtsnTable (included)
smScriptObjects.*.*.*."guest" (included)
smRunObjects.*.*.*."guest" (included)
The guestWriteView grants write access to all the table entries owned by "guest" βοΈ
guestWriteView:
smScriptObjects.*.*.*."guest" (included)
smRunObjects.*.*.*."guest" (included)
8.2. Sharing Scripts π€
This example shows how VACM can be used to share a repository of scripts between the members of the "senior" and the members of the "junior" VACM group. Shared custody, but make it cute π«Ά
vacmAccessReadView."junior"."".usm.authNoPriv = "juniorReadView"
vacmAccessWriteView."junior"."".usm.authNoPriv = "juniorWriteView"
juniorReadView:
smLangTable (included)
smExtsnTable (included)
smScriptObjects.*.*.*."junior" (included)
smRunObjects.*.*.*."junior" (included)
smScriptObjects.*.*.*."utils" (included)
juniorWriteView:
smScriptObjects.*.*.*."junior" (included)
smRunObjects.*.*.*."junior" (included)
So these definitions let "junior" members start the scripts owned by "utils" as well as the script they installed themselves. The trick is that "junior" gets read access to scripts in "utils". That means they can create entries in the smLaunchTable that point at "utils" scripts, and then launch those scripts through those entries. Smart, right? π§ β¨
vacmAccessReadView."senior"."".usm.authNoPriv = "seniorReadView"
vacmAccessWriteView."senior"."".usm.authNoPriv = "seniorWriteView"
seniorReadView:
smLangTable (included)
smExtsnTable (included)
smScriptObjects.*.*.*."senior" (included)
smRunObjects.*.*.*."senior" (included)
smScriptObjects.*.*.*."utils" (included)
seniorWriteView:
smScriptObjects.*.*.*."senior" (included)
smRunObjects.*.*.*."senior" (included)
smScriptObjects.*.*.*."utils" (included)
The definitions for "senior" members let them start the scripts owned by "utils" as well as the script they installed themselves. The third write access rule in the seniorWriteView also gives them permission to install scripts owned by "utils". So "senior" members can install and modify scripts that "junior" members are able to call π
8.3. Emergency Scripts π¨
This example shows how VACM can be used to let "junior" members launch scripts that run with the permissions associated with the "emergency" owner. It works by adding the following rules to the juniorReadView and the juniorWriteView:
juniorReadView:
smScriptObjects.*.*.*."emergency" (included)
smRunObjects.*.*.*."emergency" (included)
juniorWriteView
smLaunchStart."emergency" (included)
smLaunchArgument."emergency" (included)
The rules added to the juniorReadView give read access to the scripts, the launch buttons, and the results owned by "emergency" π. The rules added to the juniorWriteView give write permissions to the smLaunchStart and smLaunchArgument variables owned by "emergency". So "junior" members can start scripts that will execute under the owner "emergency" πββοΈπ¨
seniorReadView:
smScriptObjects.*.*.*."emergency" (included)
smRunObjects.*.*.*."emergency" (included)
seniorWriteView:
smScriptObjects.*.*.*."emergency" (included)
smRunObjects.*.*.*."emergency" (included)
The rules added to the seniorReadView and the seniorWriteView give "senior" members the rights to install emergency scripts and to configure the appropriate launch buttons π οΈ
9. IANA Considerations π
The Internet Assigned Numbers Authority (IANA) is responsible for maintaining a MIB module (IANA-LANGUAGE-MIB), which provides OID registrations for well-known languages. The IANA language registry is meant to cut down on interoperability problems by giving everyone a single list of well-known languages. That said, it's still totally possible to register languages in private OID spaces π. Private registration is especially appealing if a language is used for experimentation, or if it's only used in environments where distributing MIB modules with the language registration doesn't cause any maintenance problems π§ͺ
Any additions or changes to the list of languages registered via IANA require Designated Expert Review as defined in the IANA guidelines [RFC2434]. The Designated Expert will be selected by the IESG Area Director for the IETF Operations and Management Area π§ββοΈ
10. Security Considerations π‘οΈπ
Okay, bestie, this one is serious, so get your focus face on π₯Ή. There are a number of management objects defined in this MIB that have a MAX-ACCESS clause of read-write and/or read-create. Those objects may be considered sensitive or vulnerable in some network environments. Supporting SET operations in a non-secure environment without proper protection can have a negative effect on network operations β οΈ
SNMPv1 by itself is not a secure environment. Even if the network itself is secure (for example, by using IPSec), there is still no control over who on that secure network is allowed to access and GET/SET (read/change/create/delete) the objects in this MIB π
It is recommended that implementers consider the security features provided by the SNMPv3 framework. Specifically, the use of the User-based Security Model RFC 2574 [RFC2574] and the View-based Access Control Model RFC 2575 [RFC2575] is recommended π
It is then a customer or user responsibility to make sure the SNMP entity that gives access to an instance of this MIB is properly configured. Access to the objects should only go to those principals (users) who have legitimate rights to GET or SET (change/create/delete) them π ββοΈ
This MIB lets you distribute applications written in an arbitrary language to remote systems in a network. The security features of the languages available in a particular implementation should be taken into consideration when deploying an implementation of this MIB π§
To make access control easier for a security administrator using the View-Based Access Control Model (VACM) defined in RFC 2575 [RFC2575], the tables where multiple users may need to independently create or modify entries use the initial index as an "owner index". This initial index has a syntax of SnmpAdminString, so it can be trivially mapped to a securityName or groupName as defined in VACM, following a security policy. It's basically a neat little label for whose stuff is whose π·οΈ
All entries in related tables that belong to a particular user have the same value for this initial index. For a given user's entries in a particular table, the object identifiers for that information have the same subidentifiers (except for the "column" subidentifier) up to the end of the encoded owner index. So to configure VACM to permit access to this part of the table, you would create vacmViewTreeFamilyTable entries where vacmViewTreeFamilySubtree includes the owner index portion, and vacmViewTreeFamilyMask "wildcards" the column subidentifier. More elaborate configurations are possible π§©
The VACM access control mechanism described above controls SNMP access to Script MIB objects. There are a number of other access control issues that are outside the scope of this MIB. For example, access control on URLs, especially those that use the file scheme, must be realized by the underlying operating system. A mapping of the owner index value to a local operating system security user identity should be used by an implementation of this MIB to control access to operating system resources when resolving URLs or executing scripts π»π
11. Intellectual Property π
The IETF takes no position on the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this document. It also doesn't say whether any license under such rights might or might not be available, and it doesn't claim to have made any effort to identify such rights π€·ββοΈ. Information on the IETF's procedures for rights in standards-track and standards-related documentation can be found in BCP-11. Copies of claims of rights made available for publication, any assurances of licenses to be made available, or the result of an attempt to obtain a general license or permission for the use of such proprietary rights by implementors or users of this specification can be obtained from the IETF Secretariat π¬
The IETF invites any interested party to bring to its attention any copyrights, patents, patent applications, or other proprietary rights which may cover technology that may be required to practice this standard. Please address that information to the IETF Executive Director π
12. Changes from RFC 2592 β¨
okay so bestie, this is the glow-up list π it shows everything that changed from the previous version, which was published as RFC 2592 πΈ
- The boilerplate and the references got updated π
- Revision clauses were added to the module identity macro π¦
- Various typos got fixed, periodt π§Ή
smScriptNamenow has a SIZE restriction, which matchessmLaunchScriptName. DEFVAL was added tosmLaunchScriptName, along with some clarifying text about using a zero-length string there π- It's now clear under which conditions changes to
smScriptLanguageare invalid π - New
smScriptErrorandsmLaunchErrorobjects arrived π₯ - Setting
smRunLifeTimeto its maximum value now disables the timer, so scripts can run forever βΎοΈβ¨ - The
autostartvalue was added to thesmLaunchAdminStatusobject. It lets you launch scripts during the disable->enabled transition ofsmLaunchOperStatusπ - The "creating a launch button" procedure got an extra step that sets
smLaunchRowStatusto active π - The procedure to launch a script got a final polling step π§
- The procedure to terminate a running script also got a final polling step π
- The requirement that
smRunErroris a zero-length string whilesmRunExitCodehas the valuenoErrorwas removed. Lowkey a relief π - New
smScriptLastChange,smLaunchLastChange,smRunResultTime, andsmRunErrorTimeobjects showed up π - Some extra boilerplate text went into the security considerations section π
- A new
smLaunchRowExpireTimeobject was added, plus a newexpiredstate for thesmLaunchOperStatusobject β³ - It's now clarified that
smRunStatereports the actual state if attempts to suspend or resume scripts fail π - The conditions that can lead to inconsistentValue errors from set operations on
smLaunchControlandsmRunControlgot clarified π§ - Procedures for suspending, resuming, and removing running scripts were added to section 7 π
- Text was added to the
smScriptStorageTypedescription to highlight the difference between the storage type of the script row entry and the script itself π¦ - The
smCompliancesstatement no longer requires write access to thesmCodeTextobject after row creation πΈ smCompliance,smScriptGroup,smLaunchGroup,smRunGroup, andsmNotificationsGroupare now deprecated. In their place we gotsmCompliance2,smScriptGroup2,smLaunchGroup2,smRunGroup2, andsmNotificationsGroup2, which handle the new objects and notifications π
13. Acknowledgments
This document was produced by the IETF Distributed Management (DISMAN) working group π«Ά
14. References
- [RFC2571] Harrington, D., Presuhn, R. and B. Wijnen, "An Architecture for Describing SNMP Management Frameworks", RFC 2571, April 1999.
- [RFC1155] Rose, M. and K. McCloghrie, "Structure and Identification of Management Information for TCP/IP-based Internets", STD 16, RFC 1155, May 1990.
- [RFC1212] Rose, M. and K. McCloghrie, "Concise MIB Definitions", STD 16, RFC 1212, March 1991.
- [RFC1215] Rose, M., "A Convention for Defining Traps for use with the SNMP", RFC 1215, March 1991.
- [RFC2578] McCloghrie, K., Perkins, D., Schoenwaelder, J., Case, J., Rose, M. and S. Waldbusser, "Structure of Management Information Version 2 (SMIv2)", STD 58, RFC 2578, April 1999.
- [RFC2579] McCloghrie, K., Perkins, D., Schoenwaelder, J., Case, J., Rose, M. and S. Waldbusser, "Textual Conventions for SMIv2", STD 58, RFC 2579, April 1999.
- [RFC2580] McCloghrie, K., Perkins, D., Schoenwaelder, J., Case, J., Rose, M. and S. Waldbusser, "Conformance Statements for SMIv2", STD 58, RFC 2580, April 1999.
- [RFC1157] Case, J., Fedor, M., Schoffstall, M. and J. Davin, "Simple Network Management Protocol", STD 15, RFC 1157, May 1990.
- [RFC1901] Case, J., McCloghrie, K., Rose, M. and S. Waldbusser, "Introduction to Community-based SNMPv2", RFC 1901, January 1996.
- [RFC1906] Case, J., McCloghrie, K., Rose, M. and S. Waldbusser, "Transport Mappings for Version 2 of the Simple Network Management Protocol (SNMPv2)", RFC 1906, January 1996.
- [RFC2572] Case, J., Harrington D., Presuhn R. and B. Wijnen, "Message Processing and Dispatching for the Simple Network Management Protocol (SNMP)", RFC 2572, April 1999.
- [RFC2574] Blumenthal, U. and B. Wijnen, "User-based Security Model (USM) for version 3 of the Simple Network Management Protocol (SNMPv3)", RFC 2574, April 1999.
- [RFC1905] Case, J., McCloghrie, K., Rose, M. and S. Waldbusser, "Protocol Operations for Version 2 of the Simple Network Management Protocol (SNMPv2)", RFC 1905, January 1996.
- [RFC2573] Levi, D., Meyer, P. and B. Stewart, "SNMPv3 Applications", RFC 2573, April 1999.
- [RFC2575] Wijnen, B., Presuhn, R. and K. McCloghrie, "View-based Access Control Model (VACM) for the Simple Network Management Protocol (SNMP)", RFC 2575, April 1999.
- [RFC2570] Case, J., Mundy, R., Partain, D. and B. Stewart, "Introduction to Version 3 of the Internet-standard Network Management Framework", RFC 2570, April 1999.
- [RFC2028] Hovey, R. and S. Bradner, "The Organizations Involved in the IETF Standards Process", BCP 11, RFC 2028, October 1996.
- [RFC2396] Berners-Lee, T., Fielding, R. and L. Masinter, "Uniform Resource Identifiers (URI): Generic Syntax", RFC 2396, August 1998.
- [RFC959] Postel, J. and J. Reynolds, "File Transfer Protocol", STD 9, RFC 959, October 1985.
- [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., Masinter, L., Leach, P. and T. Berners-Lee, "Hypertext Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999.
- [RFC2434] Narten, T. and H. Alvestrand, "Guidelines for Writing an IANA Considerations Section in RFCs", BCP 26, RFC 2434, October 1998.
- [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.
15. Editors' Addresses
Here are the editors, so you know who to ping π§
David B. Levi
Nortel Networks
4401 Great America Parkway
Santa Clara, CA 95052-8185
USA
Phone: +1 423 686 0432
EMail: dlevi@nortelnetworks.com
Juergen Schoenwaelder
TU Braunschweig
Bueltenweg 74/75
38106 Braunschweig
Germany
Phone: +49 531 391-3283
EMail: schoenw@ibr.cs.tu-bs.de
16. Full Copyright Statement
Now the legal bit π It stays word for word, because it's the official fine print and it deserves to be complete π
Copyright (C) The Internet Society (2001). All Rights Reserved.
This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English.
The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns.
This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
Acknowledgement
Funding for the RFC Editor function is currently provided by the Internet Society πβ¨
π¦ where this page comes from
- ietf: rfc3165 2001-08
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms