RFC3165 - Definitions of Managed Objects for the Delegation(2)

时间:2005-02-17 来源: 作者: 点击:
-- smRunObjects OBJECT IDENTIFIER ::= { smObjects 4 } smLaunchTable OBJECT-TYPE SYNTAX SEQUENCE OF SmLaunchEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "This table lists and describes s
  
--

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
}

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.

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 RFC2271 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 }

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, RFC2578).
--

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 RFC2592.
--

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

This example explains the steps performed by a manager to push a
script into a distributed manager.

1. The manager first checks the smLangTable and the smExtsnTable in
order to select the appropriate script or language.

2. The manager creates a row in the smScriptTable by issuing an SNMP
set-request. The smScriptRowStatus object is set to
`createAndWait' and the smScriptSource object is set to an empty
string. The smScriptLanguage object is set to the language in
which the script was written. The smScriptStorageType object is
set to `volatile' to indicate that the script will be loaded via
the smCodeTable. The smScriptOwner is set to a string which
identifies the principal who owns the new row. The smScriptName
defines the administratively assigned unique name for the script.

3. The manager sets the smScriptRowStatus object to `active' and the
smScriptAdminStatus object to `editing'.

4. The manager pushes the script to the distributed manager by
issuing a couple of SNMP set-requests to fill the smCodeTable.

5. 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 the compilation of the
script if the language requires a compilation step.

6. The manager polls the smScriptOperStatus object until the value is
either `enabled' or one of the error status codes. The script can
only be used if the value of smScriptOperStatus is `enabled'.

7. If the manager wants to store the script in local non-volatile
storage, it should send a set-request which changes the
smScriptStorageType object to `nonVolatile'.

7.2. Pulling a Script from a URL

This example explains the steps performed by a manager to cause a
distributed manager to pull a script from a URL.

1. The manager first checks the smLangTable and the smExtsnTable in
order to select the appropriate script or language.

2. The manager creates a row in the smScriptTable by issuing an SNMP
set-request. The smScriptRowStatus object is set to
`createAndWait' and the smScriptSource object is set to the URL
which points to the script source. The smScriptLanguage object is
set to the language in which the script was written. The
smScriptOwner is set to a string which identifies the principal
who owns the new row. The smScriptName defines the
administratively assigned unique name for the script.

3. The manager sets the smScriptRowStatus object to `active'.

4. 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. This retrieval operation might be followed by a
compile operation if the language requires a compilation step.

5. The manager polls the smScriptOperStatus object until the value is
either `enabled' or one of the error status codes. The script can
only be used if the value of smScriptOperStatus is `enabled'.

6. If the manager wants to store the script in local non-volatile
storage, it should send a set-request which changes the
smScriptStorageType object to `nonVolatile'.

7.3. Modifying an Existing Script

This section explains how a manager can modify a script by sending
SNMP set-requests.

1. First, the script is de-activated by setting the
smScriptAdminStatus to `disabled'.

2. The manager polls the smScriptOperStatus object until the value is
`disabled'.

3. The manager sets smScriptSource to an empty string and
smScriptAdminStatus to `editing'. This makes the script source
available in the smCodeTable.

4. The manager polls the smScriptOperStatus object until the value is
`editing'.

5. The manager sends SNMP set-requests to modify the script in the
smCodeTable.

6. 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 the
compilation of the script if the language requires a compilation
step.

7. The manager polls the smScriptOperStatus object until the value is
either `enabled' or one of the error status codes. The script can
only be used if the value of smScriptOperStatus is `enabled'.

7.4. Removing an Existing Script

This section explains how a manager can remove a script from a
distributed manager.

1. First, the manager sets the smScriptAdminStatus to `disabled'.
This will ensure that no new scripts can be started while running
scripts finish their execution.

2. The manager polls the smScriptOperStatus object until the value is
`disabled'.

3. The manager sends an SNMP set-request to change the
smScriptRowStatus object to `destroy'. This will remove the row
and all associated resources from the Script MIB implementation.

7.5. Creating a Launch Button

This section explains how a manager can create a launch button for
starting a script.

1. The manager, who is identified by an smLaunchOwner value, first
chooses 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'.

2. 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.

3. The manager sets the smLaunchRowStatus object to `active'.

4. The manager sends a set-request to change smLaunchAdminStatus to
`enabled' once the new smLaunchTable row is complete.

5. The manager polls the smLaunchOperStatus object until the value is
`enabled'.

7.6. Launching a Script

This section explains the suggested way to launch a script from a
given launch button.

1. The manager first retrieves the value of smLaunchRunIndexNext from
the launch button selected to start the script.

2. The manager sends an SNMP set-request to set the smLaunchStart
object to the value obtained in step 1. This will launch 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. Upon successful start, a new row will
be created in the smRunTable indexed by smLaunchOwner,
smLaunchName and the value written to smLaunchStart.

3. The manager polls the smRunState object until the value is either
`executing' (the default case), `suspended' or `terminated'.

The first step is not required. A manager can also try to guess an
unused value for smRunIndex if the manager 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 explains how a manager can suspend a running script.

1. 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 will suspend
all running scripts started from the launch button while
smRunControl will only suspend the running script associated with
the smRunControl instance.

2. The manager polls the smRunState object until the value is either
`suspended', `executing', or `terminated'. If the value is
`suspended', then the suspend operation was successful. If the
value is `executing', then the attempt to suspend the script

failed. The value `terminated' can be received in cases where the
suspend operation failed and the running script terminated between
the polls.

Note that the set operation in the first step can lead to an
inconsistentValue error which indicates that the suspend operation
failed (e.g., because the runtime system does not support
suspend/resume). There is no need to poll smRunState in this case.

7.8. Resuming a Suspended Script

This section explains how a manager can resume a suspended script.

1. 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 will resume
all running scripts started from the launch button while
smRunControl will only resume the running script associated with
the smRunControl instance.

2. The manager polls the smRunState object until the value is either
`suspended', `executing', or `terminated'. If the value is
`executing', then the resume operation was successful. If the
value is `suspended', then the attempt to resume the script
failed. The value `terminated' can be received in cases where the
resume operation was successful and the running script terminated
between the polls.

Note that the set operation in the first step can lead to an
inconsistentValue error which indicates that the resume operation
failed (e.g., because the runtime system does not support
suspend/resume). There is 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 is as follows:

1. 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 will abort all
running scripts started from the launch button while smRunControl
will only abort the running script associated with the
smRunControl instance.

2. 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 which causes the runtime system to terminate the script with a
`lifeTimeExceeded' exit code:

1. 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.

2. The manager polls the smRunState object until the value is
`terminated'.

Note that 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 explains how a manager can remove a terminated script.

1. 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

This section explains how a manager can remove a launch button from a
distributed manager.

1. First, the manager sets the smLaunchAdminStatus to `disabled'.
This will ensure that no new scripts can be started from this
launch button while running scripts finish their execution.

2. The manager polls the smLaunchOperStatus object until the value is
`disabled'.

3. The manager sends an SNMP set-request to change the
smLaunchRowStatus object to `destroy'. This will remove the row
and all associated resources from the Script MIB implementation.

8. VACM Configuration Examples

This section shows how the view-based access control model defined in
RFC2575 [RFC2575] can be configured to control access to the Script
MIB.

8.1. Sandbox for Guests

The first example demonstrates how to configure VACM to give the
members of the VACM group "guest" limited access to the Script MIB.
The MIB views defined below give the members of the "guest" group a
sandbox where they can install and start their own scripts, but not
access any other scripts maintained by the Script MIB implementation.

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 demonstrates 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:
------分隔线----------------------------
顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------
最新评论 查看所有评论
发表评论 查看所有评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 密码: 验证码:
推荐内容