STAF LOCAL PING PING
STAF PING PING PING
STAF LOCAL VAR LIST
STAF LOCAL SERVICE LIST REQUESTS
STAF LOCAL HANDLE LIST HANDLES
STAF LOCAL HANDLE LIST HANDLES
STAF LOCAL PROCESS LIST
STAF LOCAL PROCESS START COMMAND NOTEPAD
STAF LOCAL PROCESS LIST
STAF LOCAL PROCESS LIST
STAF LOCAL LOG HELP
STAF LOCAL HELP ERROR [Error Number]
STAF LOCAL SHUTDOWN SHUTDOWN
STAF LOCAL PING PING
STAF LOCAL PING PING
STAF LOCAL HELP ERROR 21
STAF LOCAL VAR RESOLVE STRING {STAF/Config/MachineNickname}
STAF LOCAL LOG LOG MACHINE LOGNAME log1 LEVEL info message test-message
STAF LOCAL LOG LIST MACHINES
STAF LOCAL LOG QUERY MACHINE xxx.austin.ibm.com LOGNAME log1
MACHINENICKNAME testmachine1and restart STAF.
STAF LOCAL VAR RESOLVE STRING {STAF/Config/MachineNickname}
STAF LOCAL LOG LOG MACHINE LOGNAME log2 LEVEL info message second-message
STAF LOCAL LOG LIST MACHINES
STAF LOCAL LOG QUERY MACHINE testmachine1 LOGNAME log2
staf local var set system var HandsOn/Variables/MyVar=xyz
staf local var resolve string {HandsOn/Variables/MyVar}Verify that you get "xyz" as the result.
staf local var resolve string {HandsOn/Variables/MyVar}What is the result? ___________________________________________________________
staf local var listand verify that HandsOn/Variables/MyVar=xyz is listed.
staf local var helpto see the help for the Variable service.
staf local var resolve string {HandsOn/Variables/MyVar}and verify that the response is "xyz".
staf local var resolve string {HandsOn/Variables/MyVar}and verify that the response is "xyz". Why is this variable still set to "xyz"?
service email library JSTAF execute C:/STAF/services/email/STAFEmail.jar \Save the changes to the STAF.cfg file.
parms "mailserver na.relay.ibm.com"
staf local service listand verify that the Email service is listed.
staf local email versionand verify that the Email service version is 3.1.1.
staf local email helpand verify that you get the Help for the email Service.
C:/STAF/data/STAF/lang/java/jvm/STAFJVM1/JVMLog.lThis file will contain any Java errors/exceptions that the Event service (and any other Java STAF services) encounters. The end of the file should be similar to:
****************************************************************************** *** 20041203-09:46:17 - Start of Log for JVMName: STAFJVM1 *** JVM Executable: java *** JVM Options : none ******************************************************************************
staf local process start command java parms "SimpleTestcase 10" env CLASSPATH={STAF/Env/Classpath};C:/STAF/testcases
staf local process list handlesWhat is the output? __________________________________________________________
staf local process free handle XXwhere XX is the handle that was listed in the process query all request
staf local process list handlesWhat is the output now, and why has it changed? __________________________________________________________
staf local process start command java parms "STAFTestcase 60" env CLASSPATH={STAF/Env/Classpath};C:/STAF/testcasesNote that after you execute the command, the response contains a number, which is the handle number for the STAFTestcase.
RETURNSTDOUT STDERRTOSTDOUT WAITat the end of the command. This will give you detailed information about the error.
staf local monitor helpto familiarize yourself with the Monitor service.
staf local monitor query machine testmachine1 handle YYsubstituting the handle number for STAFTestcase for YY. Notice that the response you get back is the current information (loop #) which the testcase is publishing. Execute this command several times to get the latest status of the testcase.
staf local log helpto familiarize yourself with the Log Service commands.
staf local log list machine testmachine1
staf local process start command java parms "STAFTestcase1 15" env CLASSPATH={STAF/Env/Classpath};C:/STAF/testcases
staf local log query machine testmachine1 logname STAFTestcase1.logYou should see 15 Loop # lines.
staf local log query machine testmachine1 logname STAFTestcase1.log last 5You should see the last 5 lines in the log file.
staf local process start command java parms "STAFTestcase2 15" env CLASSPATH={STAF/Env/Classpath};C:/STAF/testcasesYou should see the testcase behaving as before, but it is now using the STAF Delay service to delay 1 second between each loop.
staf local var helpto familiarize yourself with the Var Service commands.
if ((varResult.rc == 0) && (varResult.result.equals("STAFTestcase3/Terminate"))) { System.exit(0); }In the C:\STAF\testcases directory, type "javac STAFTestcase3.java"
staf local process start command java parms "STAFTestcase3 100" env CLASSPATH={STAF/Env/Classpath};C:/STAF/testcasesNote the handle number given to the testcase.
staf local var handle YY set var HandsOn/Variables/MyVar=STAFTestcase3/Terminatewhere YY is the handle number for STAFTestcase3.
staf local queue helpto familiarize yourself with the Queue Service commands.
if ((queueResult.rc == 0) && !(queueResult.result.equals(null))) { STAFQueueMessage message = new STAFQueueMessage(queueResult.result); if (message.message.equals("STAFTestcase4/Terminate")) { System.exit(0); } }In the C:\STAF\testcases directory, type "javac STAFTestcase4.java"
staf local process start command java parms "STAFTestcase4 100" env CLASSPATH={STAF/Env/Classpath};C:/STAF/testcasesNote the handle number given to the testcase.
staf local queue queue handle YY message STAFTestcase4/Terminatewhere YY is the handle number for STAFTestcase4.
staf XX process start command java parms "STAFTestcase4 100" env CLASSPATH={STAF/Env/Classpath};C:/STAF/testcaseswhere XX is the hostname of your neighbor's machine.
staf XX trust listwhere XX is the hostname of your neighbor's machine. Your machine's is not listed, and the Default Trust level is 3.
staf XX process start command java parms "STAFTestcase4 100" env CLASSPATH={STAF/Env/Classpath};C:/STAF/testcaseswhere XX is the hostname of your neighbor's machine. This time the testcase should successfully start. Note the handle number given to the testcase.
staf XX queue queue handle YY message STAFTestcase4/Terminatewhere XX is the hostname of your neighbor's machine and YY is the handle number for STAFTestcase4.
staf local process start shell command "java -version" stderrtostdout returnstdout waitThe result should contain the version information for the Java installed on your machine.
staf local fs list directory {STAF/Config/STAFRoot}/binThe result should contain contents of the STAF bin directory.
staf local log log machine logname log3 level info message test-message
staf local log log machine logname log3 level info message "Another message"Now query the log:
staf local log query machine {STAF/Config/MachineNickname} logname log3The result should contain the 2 records in the log.
staf local trace help
staf local trace enable tracepoints "servicerequest serviceresult"
staf local ping ping
staf local trace disable all services
staf local ping ping
staf local trace enable service process
staf local process start shell command time returnstdout wait
staf local trace disable all services