This subsection provides an example of collecting process information under the conditions shown in the following table.
Table 6-24 Conditions for collecting performance data in the example
Option | Explanation | Corresponding field | Value |
---|---|---|---|
tt | Transaction type | Trans Type | TotalMemory |
ki | Transaction key (numeric type) | Trans Data Key | Process ID |
ss | Short string | User String 1 | Process name |
u | Unsigned long type | User Unsigned Long 1 | Amount of memory in use |
The following are examples of user commands (userapplication_script and userdata_script) that acquire process information from UNIX and output user-created data.
#!/bin/ksh
echo "Product Name=PFM-Agent for Platform (UNIX)"
echo "FormVer=0001"
echo "tt ki ss u"
ps -eo pid,comm,vsz,rss | grep jpcagtu | awk '{ printf("TotalMemory %d %s %d\n",$1,$2,$3+$4);}'
#!/bin/ksh
echo "Product Name=PFM-Agent for Platform (UNIX)"
echo "FormVer=0001
"echo "tt ks u u"
df -k |grep pshp02 |awk '{ printf("RemoteDisk %s %d %d\n",$6,$3,$4);}'
The following are examples of user-created data output by the user commands above.
Product Name=PFM-Agent for Platform (UNIX)
FormVer=0001
tt ki ss u
TotalMemory 0 COMMAND 0
TotalMemory 0 sched 0
TotalMemory 1 /etc/init 1584
TotalMemory 2 pageout 0
TotalMemory 3 fsflush 0
TotalMemory 442 /usr/lib/saf/sac 2808
...
Product Name=PFM-Agent for Platform (UNIX)
FormVer=0001
tt ks u u
RemoteDisk /home1/jp1ps 67318256 4473056
RemoteDisk /home2/jp1ps 43867064 27738672
...
The following gives an example of a shell script (UserDefinedData.sh) for using functionality for periodically executing user commands.
# Delete old user-created data.
rm -Rf /opt/perfdata.txt /opt/userdata.txt
# Generate user-created data.
/opt/userapplication_script >> /opt/perfdata.txt
/opt/userdata_script >> /opt/userdata.txt
# Use the jpcuser command to convert the data.
/opt/jp1pc/agtu/agent/jpcuser/jpcuser PD_UPD -file /opt/perfdata.txt -file /opt/userdata.txt#
#: If -debug 2 is specified, debug log information is output to the following directory:
/opt/jp1pc/agtu/agent/jpcuser/debug/