Hitachi

JP1 Version 12 for UNIX Systems JP1/Performance Management - Agent Option for Platform Description, User's Guide and Reference


7.4.3 Example of collecting user-specific performance data (for a physical host environment)

This subsection provides an example of collecting process information under the conditions shown in the following table.

Table 7‒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

16-byte character 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 (for a physical host environment)

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
  ...
Note

(2) Example of a shell script used to perform periodic collection (for a physical host environment)

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/
Note

The following example sets the shell script to be executed at every one minute using the UNIX cron command.

* * * * * /opt/UserDefinedData.sh