Job Management Partner 1 Version 10, Job Management Partner 1/Performance Management - Agent Option for Platform Description, User's Guide and Reference

[Contents][Glossary][Index][Back][Next]

6.4.3 Example of collecting user-specific performance data

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
Organization of this subsection
(1) Examples of user commands
(2) Example of a shell script used to perform periodic collection

(1) Examples of user commands

The following are examples of user commands (userapplication_script and userdata_script) that acquire process information from UNIX and output user-created data.

userapplication_script:
#!/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);}'

userdata_script:
#!/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.

Example of user-created data output by userapplication_script:
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
  ...

Example of user-created data output by userdata_script:
Product Name=PFM-Agent for Platform (UNIX)
FormVer=0001
tt ks u u
RemoteDisk /home1/jp1ps 67318256 4473056
RemoteDisk /home2/jp1ps 43867064 27738672
  ...
Reference note

(2) Example of a shell script used to perform periodic collection

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/
Reference note
The following example sets the shell script to be executed at every one minute using the UNIX cron command.
* * * * * /opt/UserDefinedData.sh