Home Implementation Testing Add-Ons > disman API > Smurf > JAX > Schedule-MIB > Tcl Engine Documentation Download Mailinglist People |
The Jasmin Project
Manual Page (Tnm::smx.n)
Tnm::smx(n) Tnm Tcl Extension Tnm::smx(n) _________________________________________________________________ NAME Tnm::smx - Interact with a controlling SMX peer. _________________________________________________________________ DESCRIPTION The SMX protocol defined in RFC 2593 is used to interface script runtime systems like a Tcl interpreter with the language independent Script MIB as defined in RFC 2592. The Tnm SMX support provides a way to install and execute Tcl scripts on remote devices by using the SNMP management protocol. A Tcl interpreter becomes an SMX controlled runtime engine automatically during Tnm initialization if the SMX_PORT and SMX_COOKIE variables described in RFC 2593 exist in the process environment. The Tnm extension automatically sets up a TCP connection to the SMX_PORT on the local host. Once the SMX control connection has been estab- lished, the SMX protocol engine will listen for SMX com- mands. Every script invoked via the SMX start command will execute in its own Tcl interpreter in the same pro- cess. EXECUTION MODEL A single operating system level process can execute multi- ple Tcl scripts under SMX control. Every script runs it is own Tcl interpreter and does not share any Tcl resources (variables, procedures) with other concurrently running scripts. +-----------+ +-----------+ | interp #1 | . . . | interp #n | +-----------------------------------+ script | master Tcl interpreter | <- defining +-----------------------------------+ profiles | SMX protocol implementation (Tnm) | +-----------------------------------+ Tcl interpreters executing scripts are all slave inter- preters of the application's main Tcl interpreter. All slave interpreters are safe Tcl interpreters. The master interpreter can therefore be used to establish security profiles. A security profile is basically a set of aliases etc. which is installed in a slave interpreter during startup. Security profiles are implemented as Tcl proce- dures that are loaded into the master interpreter during the initialization of the Tnm extension. The master inter- preter can also be used to establish communication paths between scripts executing in different Tcl interpreters. Tnm January 2001 1 Tnm::smx(n) Tnm Tcl Extension Tnm::smx(n) SMX COMMAND The Tnm::smx command can be invoked by scripts to send results or log messages to the controlling SMX peer. Tnm::smx exit [-code code] [string] The Tnm::smx exit command must be used to terminate a script. The optional string argument defines the result or error message which is sent to the con- trolling SMX peer. The -code option can be used to define the exit code which is returned to the controlling SMX peer. The code argument must be one of the values noEr- ror, halted, lifeTimeExceeded, noResourcesLeft, languageError, runtimeError, invalidArgument, secu- rityViolation, or genericError. The exit code noEr- ror is used if the -code option is not present. Tnm::smx log message The Tnm::smx log command writes a message to the logging facility provided by the controlling SMX peer. Tnm::smx profiles [list] The Tnm::smx profile command installs or retrieves the list of known runtime security profiles. Each element in the list identifies a runtime security profile. The Tnm::smx profile command always returns the list of installed profiles. The list of known profiles is updated if the optional list argument is present. Security profiles are implemented by Tcl procedures in the master interpreter with the same name. The SMX protocol implementation will automatically cre- ate a new slave Tcl interpreter when a new script is started. The Tnm extension calls the runtime security profile procedure in the master inter- preter during the initialization of the slave interpreter so that the master can setup the secu- rity environment before script execution starts. The name of the slave interpreter is passed to the procedure so that the master can access the slave interpreter. The Tnm::smx profiles command may only be used by a master Tcl interpreter which implements security profiles for safe interpreters that are executing scripts. Invoking the command from a safe slave interpreter will cause an error. Tnm::smx result [-notify] string The Tnm::smx result command writes a string to the Tnm January 2001 2 Tnm::smx(n) Tnm Tcl Extension Tnm::smx(n) controlling SMX peer. The SMX peer will then store the string in the smRunResult object of the DISMAN- SCRIPT-MIB (RFC 2592). The -notify option can be used to let the controlling SMX peer generate a smScriptResult notification. VARIABLES The SMX implementation sets the following global Tcl vari- ables before a script is executed: argc Contains a count of the number of arguments (0 if none), not including the name of the script file. argv Contains a Tcl list whose elements are the arguments, in order, or an empty string if there are no arguments. argv0 Contains the script name. SEE ALSO scotty(1), Tnm(n), Tcl(n) AUTHORS Juergen Schoenwaelder <schoenw@ibr.cs.tu-bs.de> Tnm January 2001 3
© 2000 TU Braunschweig, NEC C&C Europe -
Wed Sep 5 12:28:05 2001
|