HP-UX Workload Manager User's Guide

Advanced WLM usage: Using performance metrics
Supplying data to WLM
Appendix H 497
}
# Set up wlmrcvdc
tune job_time {
coll_argv = wlmrcvdc;
}
Next, set up wlmsend in a loop in a shell script. Here, the function
get_value provides the metrics to feed wlmsend. Alternatively the script
itself could be interacting with the workload to gather performance data.
Add a sleep command to slow down how often metrics are retrieved. The
loop might look like the following:
while (true)
do
value = ‘get_value‘
/opt/wlm/bin/wlmsend job_time $value
sleep 60
done
NOTE Run your data collection script in the group PRM_SYS to ensure it receives
the proper resources.
For background information on how wlmsend and wlmrcvdc work
together to get your data to WLM, as well as a warning about I/O
buffering, see “Sending data with wlmsend and wlmrcvdc: How it works”
on page 509.
Sending data from a perl program
If you have data you want to send to WLM from a perl program, use
wlmsend in the perl program and an associated wlmrcvdc in your WLM
configuration file. This method of sending data works for a single metric
value that is specified as an argument to wlmsend or for a stream of
metric values that is piped to wlmsend, as shown in the following
example.
In this example, start in the configuration file by defining an slo
structure to keep the metric job_time under 2.0, and then set up
wlmrcvdc to receive the job_time metric values from wlmsend:
# Set up the SLO
slo data_cruncher {
pri = 3;