PFM - Agent for Platform provides functionality to convert user-specific performance data output by users to text files (user-created data) into a format that can be stored in records provided by PFM - Agent for Platform (user data files). For details about user-specific performance data, see 6.4 Settings for collecting user-specific performance data.
The following shows an example for collecting used port information in PI_UPIB records as user-specific performance data. The following table shows the format in which used port information is stored.
Option | Value |
---|---|
tt | "TCP" |
ks | The host name |
lr | The total number of TCP ports for the host |
lr | The number of currently active TCP ports for the host |
lr | The number of listening TCP ports for the host |
To collect information:
#!/bin/sh
echo "Product Name=PFM-Agent for Platform (UNIX)" > /homework/userdata.tcp
echo "FormVer=0001" >> /homework/userdata.tcp
echo "tt ks lr lr lr" >> /homework/userdata.tcp
#All TCP port
ALL_TCP=`netstat -at | wc -l`
ALL_TCP=`expr $ALL_TCP - 2`
#Active TCP port
ACTIVE_TCP=`netstat -at | grep ESTABLISHED | wc -l`
#Listen TCP port
LISTEN_TCP=`netstat -at | grep LISTEN | wc -l`
#Output
echo "TCP `uname -n` $ALL_TCP $ACTIVE_TCP $LISTEN_TCP" >> /homework/userdata.tcp
Product Name=PFM-Agent for Platform (UNIX)
FormVer=0001
tt ks lr lr lr
TCP jp1ps05 15 3 12
/opt/jp1pc/agtu/agent/jpcuser/jpcuser PI_UPIB
-file /homework/userdata.tcp