Hi,

It appears that you install the STAX.jar file in the recommended 
services/stax subdirectory off the root STAF directory.  While there isn't 
a STAX Python variable for this, there is a STAF variable for the root 
STAF directory -- STAF/Config/STAFRoot. -- that you can use.  STAF 
variables in the COMMAND option value for a PROCESS START request are 
resolved by the STAF PROCESS service.  So, if this is the location where 
the STAX.jar file can always be found, another alternative is to specify 
it in the path.  For example:
 
  <stafcmd name="'open_stax_monitor'">
    <location>'local'</location>
    <service>'PROCESS'</service>
    <request>
      'START COMMAND "java -jar {STAF/Config/STAFRoot}
/services/stax/STAXMon.jar \
      -job %s"' % STAXJobID
    </request>
  </stafcmd>

If you want a STAX variable that you could use to get the directory where 
the STAX service is installed, feel free to open a new STAF Feature 
Request to add a new STAX variable via the STAF home page at 
http://staf.sourceforge.net and selecting "Request New Feature" from the 
navigation panel on the left in the "Feedback" section.

And as you mentioned, if the STAXMon.jar file's location could vary, you 
could get the value by submitting a "QUERY SERVICE STAX" request to the 
SERVICE service.  For example as seen in blue below:

    <if expr="debug != 0">
      <sequence>
        <!-- debug -->

        <log message="1">'Start the STAX Monitor for this job'</log>

        <stafcmd name="'Query STAX Service'">
          <location>'local'</location>
          <service>'SERVICE'</service>
          <request>'QUERY SERVICE %s' % (STAXServiceName)</request>
        </stafcmd>

        <if expr="RC != 0">
          <sequence>
            <log message="1">
              'Terminated job because cannot open STAX Monitor.\n \
              STAF local SERVICE QUERY SERVICE %s failed with RC=%s \
              Result=%s' % (STAXServiceName, RC, STAFResult)
            </log>
            <terminate block="'main'"/>
          </sequence>
        </if>

        <script>
          import os
          staxDirectory = os.path.dirname(STAFResult['executable'])
          staxDirectory = staxDirectory.replace('\\', '/')
          command = 'java -jar %s/STAXMon.jar -job %s' % (staxDirectory, 
STAXJobID)
          request = 'START COMMAND "%s"' % (command) 
        </script>

        <log message="1">'STAF local PROCESS %s' % (request)</log>

        <stafcmd name="'Open STAX Monitor'">
          <location>'local'</location>
          <service>'PROCESS'</service>
          <request>request</request>
        </stafcmd>

        <if expr="RC != 0">
          <log message="1">
            'Open STAX Monitor for this STAX job failed, RC=%s, Result=%s' 
% \
            (RC, STAFResult)
          </log>
          <else>
            <sequence>
              <log message="1">'Delay 5 seconds'</log>
              <stafcmd name="'Wait 5s'">
                <location>'local'</location>
                <service>'DELAY'</service>
                <request>'DELAY 5s'</request>
              </stafcmd>
            </sequence>
          </else>
        </if>

      </sequence> 
    </if>

--------------------------------------------------------------
Sharon Lucas
IBM Austin,   luc...@us.ibm.com
(512) 286-7313 or Tieline 363-7313




From:   Cyril SANTUNE <cyril.sant...@gmail.com>
To:     Sharon Lucas/Austin/IBM@IBMUS, 
Cc:     staf-users@lists.sourceforge.net
Date:   01/08/2014 04:23 AM
Subject:        Re: [staf-users] Stax monitoring and CLI



Thanks,


I add this at the beginning of my script as "debug mode"

 <if expr="debug != 0">
        <sequence>
          <!-- debug -->
          <stafcmd name="'open_stax_monitor'">
            <location>'local'</location>
            <service>'PROCESS'</service>
            <request>
              'START COMMAND java -jar C:\STAF/services/stax/STAXMon.jar \
              -job %s' % STAXJobID
            </request>
          </stafcmd>
          <block name="'Wait 5s'">
            <script> time.sleep(5) </script>
          </block>
        </sequence>
      </if>

I hardcode the path of staxmon.jar, I need to improve this.
I look in the STAX variable but I don't find this path.
I just find this :
staf local service query service stax
Response
--------
{
  Name      : STAX
  Library   : JSTAF
  Executable: C:\STAF/services/stax/STAX.jar
  Options   : []
  Parameters: <None>
}

So, I will probably do a python script to extract the path.


On Mon, Jan 6, 2014 at 9:43 PM, Sharon Lucas <luc...@us.ibm.com> wrote:
The STAX Monitor only lists STAX jobs that are currently running, not STAX 
jobs that have already completed unless you were monitoring a STAX job 
when it completed then its monitor window will remain open after the job 
has completed.  So, this explains the behavior you are seeing. 

The STAX Monitor provides command line options that allow you to do things 
that you requested.   To monitor a specific STAX job that is currently 
running, you can specify the "-job" command line option.  For example, to 
start the STAX Monitor specifying to monitor a currently running STAX job 
with job ID 2: 
    java -jar STAXMon.jar -job 2 

So you could use this command after submitting a STAX EXECUTE command to 
start a STAX job (assuming that STAX job has not yet completed). 

Or, better yet, specify the "-jobparms" command line option when starting 
the STAX Monitor to start executing a STAX job as well as monitoring it. 
 For example, to start the STAX Monitor specifying to submit a new STAX 
job defined by Job Parameters File "C:\Documents and 
Settings\Administrator\Test1": 
    java -jar STAXMon.jar -jobparms "C:\Documents and 
Settings\Administrator\Test1" 

Note that the STAX Monitor allows you to save the information you use to 
start each job in a Job Parameter File by selecting "File" from the menu 
bar on the "STAX Job Parameters" panel and then selecting "Save As...".  A 
"Save Current Job Parameters as" panel will be displayed which lets you 
specify the name and directory of the Job Parameters File to create and it 
is this file name that you can specify when using the "-jobparms" option. 

See section "Starting the STAX Monitor" in the STAX User's Guide at 
http://staf.sourceforge.net/current/STAX/staxug.html#Header_StartMonitor 
for more information. 

And note that you can get help on the command line options available when 
starting the STAX Monitor, by specifying the "-help" option.  For example: 


java -jar STAXMon.jar -help 

STAXMonitor Help 

-job <jobNumber> [-closeonend] 
-jobparms <jobParmsFile> [-closeonend] 
-extensions 
-properties [-staxMachine <machineName>] [-staxServiceName <serviceName>] 
            [-noStart] 
-help 
-version 

And see section "Starting the STAX Monitor" in the STAX User's Guide at 
http://staf.sourceforge.net/current/STAX/staxug.html#Header_StartMonitor 
for more information. 

--------------------------------------------------------------
Sharon Lucas
IBM Austin,   luc...@us.ibm.com
(512) 286-7313 or Tieline 363-7313




From:        Cyril SANTUNE <cyril.sant...@gmail.com> 
To:        staf-users@lists.sourceforge.net, 
Date:        01/06/2014 10:02 AM 
Subject:        [staf-users] Stax monitoring and CLI 




Hi all, 

I already read some questions about this suject but I didn't find an 
answer. 

I start Stax Monitor (Staxmon.jar) however I use a command line to start 
several stax scenarios (staf local stax execute file...). 

My problem is, I want to open, for each test, "stax 3 job monitor" with 
all my running job and "stax job monitor" with the detail of the job 
automatically. 

If it is not possible. I like to use the stax job monitor as dashboard to 
see if my test is complete or not etc. But At the end of the test, if I 
don't open manualy the monitor windows (right click on job "start 
monitoring") at the end of the test, the job disappears.  
is There a way to modified this behavior ? 

Thanks 


------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 

Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics 
Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users


------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to