📄 monsrv.script
字号:
.***************************************************************************.* Software Testing Automation Framework (STAF).* (C) Copyright IBM Corp. 2001.*.* This software is licensed under the Common Public License (CPL) V1.0..****************************************************************************.*************************-START-OF-PROLOG-****************************.*.* File Name : MonSrv SCRIPT.* Descriptive Name: Software Testing Automation Framework.* Detail : This file describes the STAF Monitor Service..*.**************************-END-OF-PROLOG-*****************************:i1.monitor service:ih1.services:i2.monitor service:h2 id=monsrv.Monitor Service:h3.DescriptionThe Monitor service is an external STAF service that provides the followingfunctions::ul compact.:li.LOG - Write monitor data:li.QUERY - Query monitor data:li.LIST - List the Monitor settings or machines/handles that have logged data:li.DELETE - Delete monitor data:li.SET - Set the monitor parameters:li.&help.:eul.The purpose of the Monitor service is to give a test case the abilityto write status messages. This allows someone to query a process orworkload and easily get the current status. The status messages are storedbased on a combination of the originating machine and the process handle(where only the process can update the status message), or on a combinationof the originating machine and a specified monitor name (where any process onthe originating machine can update the named monitor). The Monitor serviceonly keeps the last monitor message it receives from a particular machine andprocess/name. A "centralized network clipboard" is a term that could beused to describe the Monitor service. All Monitor service status messages arelost when STAFProc is shutdown or the Monitor service is dynamically removed..*.*---------------------------------------------------------------------.*:ih1.registration:i2.monitor service:h3.RegistrationThe Monitor service is written in C and since it is an external service,it must be registered with the SERVICE configuration statement. Thesyntax is::xmp.SERVICE <Name> LIBRARY STAFMon PARMS <Parms>:exmp.:p.:xph.<Name>:exph. is the name by which the Monitor service will be known on this machine.:p.:xph.<Parms>:exph. is any parameters that are accepted at initialization time. The sameparameters for the Monitor SET command can be specified during initialization time. See theMonitor SET command for details on the available parameters.:h4.Example:xmp.service Monitor library STAFMon PARMS "RESOLVEMESSAGE MAXRECORDSIZE 512":exmp..*.*---------------------------------------------------------------------.*:ih1.variables:i2.monitor service:h3.VariablesThe following variables are defined in the STAF configuration fileand Monitor will query their values::sl compact.:li.:xph.STAF/Service/<Name>/ResolveMessage::exph. Whether to resolve variables in the message:esl.:h4.STAF/Service/<Name>/ResolveMessageThis flag determines if messages should be resolved before writing them.If message resolution is desired, then a call to the STAF variableservice is made and all variables are resolved. If for any reason theresolution is unsuccessful (i.e. unbalanced braces {}, infinite recursion, etc.)then an error code will be returned.:note.Note that this variable will only be examined if the ENABLERESOLVEMESSAGEVAR optionis set either during the Monitor registration (via the PARMS options) or by use of theSET ENABLERESOLVEMESSAGEVAR Monitor command.:note.The default if STAF/Service/:xph.<Name>:exph./ResolveMessage is not specified, isnot to resolve messages. This is due to the fact that you can resolve variablesyourself before logging messages and the fact that the messages could be quitelarge. This can be overridden on a per message basis by using theRESOLVEMESSAGE or NORESOLVEMESSAGE option.:enote.:sl compact.:li.:hp2.Example::ehp2. var STAF/Service/:xph.<Name>:exph./ResolveMessage=1:li.:hp2.Default::ehp2. 0 :esl.An example would be a monitor message of "Machine booted from {STAF/Config/BootDrive}",if STAF/Service/<Name>/ResolveMessage was set to 1 then what would actuallybe logged would look like: "Machine booted from C:". IfSTAF/Service/Monitor/ResolveMessage was set to 0 then the original textof the message would be logged: "Machine booted from {STAF/Config/BootDrive}"..*.*---------------------------------------------------------------------.*:ih1.service commands:ih2.LOG:i3.monitor service:h3.LOGWrites monitor data.:h4.Syntax:xmp.LOG MESSAGE <Message> [NAME <Name>] &lbrk.RESOLVEMESSAGE | NORESOLVEMESSAGE&rbrk.:exmp.:p.:xph.MESSAGE:exph. contains the message (data) that you want to write tothe monitor. This option will not resolve messages by default but can beconfigured to do so in the STAF configuration file or by using RESOLVEMESSAGE.Any private data in the message will be masked before writing to the monitor.:p.:xph.NAME:exph. indicates that the status message should be written to thespecified named monitor. This option will be resolved for variables. If thisoption is not specified, the status message will be written to the originatinghandle's monitor.:p.:xph.RESOLVEMESSAGE:exph. causes the MONITOR service to call the STAFvariable service to resolve any variables in the message before being written.:p.:xph.NORESOLVEMESSAGE:exph. causes the MONITOR service to not call the STAFvariable service to resolve any variables in the message.:h4.Security:p.&seclvl. 3.:h4.Return Codes:p.All return codes from LOG are documented in :hdref refid=retcode..:h4.Results:p.The result buffer will contain no data on return from a LOG command.:h4.Examples:sl compact.:li.LOG MESSAGE &colon.33&colon.Testcase aborted with error "255":li.LOG MESSAGE "Step1 in Test1 initiated on bootdrive {STAF/Config/BootDrive}":li.LOG MESSAGE "TestW: Step 32 of 109" NAME ActiveXYZRequests:li.LOG MESSAGE Recovered:esl..*.*---------------------------------------------------------------------.*:ih1.service commands:ih2.QUERY:i3.monitor service:h3.QUERYAllows you to query a message from a monitor based on the machine nicknamge and process handle that generated the monitor message.:h4.Syntax:xmp.QUERY MACHINE <Machine Nickname> < HANDLE <Handle> | NAME <Name> >:exmp.:p.:xph.MACHINE:exph. determines what machine the monitor message originatedfrom. &varres.:p.:xph.HANDLE:exph. determines the process handle that originated themessage. &varres.:p.:xph.NAME:exph. determines the name of themessage. &varres.:h4.Security:p.&seclvl. 2.:h4.Return Codes:p.All return codes from QUERY are documented in :hdref refid=retcode..:h4.Results:p.The result buffer will contain a marshalled:xph.<Map&colon.STAF/Service/Monitor/MonitorInfo>:exph., representingthe last monitor message generated by the specified machine/handle orfor the specified machine/name..The map is defined as follows: :table cols='* * * *'.:tcap.Definition of map class STAF/Service/Monitor/MonitorInfo:tnote text='Description'.This map class represents a monitor message.:thd.:c.Key Name:c.Display Name:c.Type:c.Format / Value:ethd.:row.:c.timestamp:c.Date-Time:c.&stringObj.:c.×tampFormat.:row.:c.message:c.Message:c.&stringObj.:c.:tnote text='Notes'.The "Date-Time" is the date/time at which the last monitormessage was logged.:etnote.:etable.:h4.Examples:ul.:li.:hp2.Goal::ehp2. Show me the monitor message from machine automate.austin.ibm.com andprocess handle 32:p.:hp2.Syntax::ehp2. :xph.QUERY MACHINE automate.austin.ibm.com HANDLE 32:exph.:p.:hp2.Results::ehp2. If the request is submitted from thecommand line, the result, in default format, could look like::xmp.Date-Time: 20040911-16:00:32Message : Testcase aborted with error "255":exmp.:li.:hp2.Goal::ehp2. Show me the monitor message from machine testmachine1.company.com andprocess handle 85 (assuming its machine nickname is testmachine1):p.:hp2.Syntax::ehp2. :xph.QUERY MACHINE testmachine1 HANDLE 85:exph.:p.:hp2.Results::ehp2. If the request is submitted from thecommand line, the result, in default format, could look like::xmp.Date-Time: 20041022-17:58:01Message : TestC: Step 2 of 5:exmp.:li.:hp2.Goal::ehp2. Show me the monitor message from machine automate.austin.ibm.com andmonitor name ActiveXYZRequests:p.:hp2.Syntax::ehp2. :xph.QUERY MACHINE automate.austin.ibm.com NAME ActiveXYZRequests:exph.:p.:hp2.Results::ehp2. If the request is submitted from thecommand line, the result, in default format, could look like::xmp.Date-Time: 20061205-08:24:01Message : TestW: Step 32 of 109:exmp.:eul..*.*---------------------------------------------------------------------.*:ih1.service commands:ih2.LIST:i3.monitor service:h3.LISTAllows you to list Monitor settings, the names of the machines that have logged monitor data, or the monitor information for a given machine.:h4.Syntax:xmp.LIST <MACHINES | MACHINE <Machine> [NAMES] | SETTINGS>:exmp.:p.:xph.MACHINES:exph. indicates you want list all the machine nicknames thathave created monitor data.:p.:xph.MACHINE:exph. indicates you want to list the monitor data for thespecified machine nickname. &varres. If the :xph.NAMES:exph. option isspecified, only the monitor data for named monitors will be displayed;otherwise, the monitor data for (un-named) process handles will be displayed.:p.:xph.NAMES:exph. indicates you want to list the named monitors for thespecified machine nickname. &varres.:p.:xph.SETTINGS:exph. returns the Monitor settings.:h4.Security:p.&seclvl. 2.:h4.Return Codes:p.All return codes from LIST are documented in :hdref refid=retcode..:h4.Results:p.The result buffer will contain data based on the LIST command::p.:ul.:li.If the :xph.MACHINES:exph. option is specified, the result buffer willcontain a marshalled :xph.<List>:exph. of &stringObj., which represents
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -