STAF provides variables that contains the physical memory on a machine (in 
bytes, KB, or MB).  You can get a STAF variable's value by submitting a 
RESOLVE request to the STAF VAR service.  For example:

C:\>STAF local VAR RESOLVE STRING {STAF/Config/Mem/Physical/Bytes}
Response
--------
2128842752

C:\>STAF local VAR RESOLVE STRING {STAF/Config/Mem/Physical/KB}
Response
--------
2078948

C:\>STAF local VAR RESOLVE STRING {STAF/Config/Mem/Physical/MB}
Response
--------
2030

Via a STAX job, you would do this using a <stafcmd> element to submit the 
RESOLVE request to the VAR service.  For example:

<stafcmd>
  <location>machine</location>
  <service>'VAR'</service>
  <request>'RESOLVE STRING {STAF/Config/Mem/Physical/Bytes}'</request>
</stafcmd>

<if expr="RC == 0">
  <log message="1">'Physical memory in bytes on machine %s is %s' % 
(machine, STAFResult)</log>
</if>

STAF does not provide a way to directly get the number of processes 
running or CPU usage.  But you could use a <process> element to run an 
operating system command or whatever command to get this information.

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




From:   Sunny Arora <sunnyaror...@gmail.com>
To:     staf-users@lists.sourceforge.net, 
Date:   12/13/2011 04:38 AM
Subject:        [staf-users] STAX script query



Hi, 

Is there any method to find number of process running,cpu usage and 
physical memory using STAX scripts. 


Thanks, 
Sunny
------------------------------------------------------------------------------
Systems Optimization Self Assessment
Improve efficiency and utilization of IT resources. Drive out cost and 
improve service delivery. Take 5 minutes to use this Systems Optimization 
Self Assessment. http://www.accelacomm.com/jaw/sdnl/114/51450054/
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

------------------------------------------------------------------------------
Cloud Computing - Latest Buzzword or a Glimpse of the Future?
This paper surveys cloud computing today: What are the benefits? 
Why are businesses embracing it? What are its payoffs and pitfalls?
http://www.accelacomm.com/jaw/sdnl/114/51425149/
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to