User Tools

Site Tools




dnf -y install pcp-zeroconf
# Verify pcp installation on application level:

Metrics and archives

# Which metrics are offered by the running pmcd?
# Which metrics related to cpu are available?
pminfo | grep cpu

# Set a variable to current archive, and evaluate
# how many metrics are logged in the archive:
cd /var/log/pcp/pmlogger/<hostname>
pminfo -a <archivename> | wc -l
pminfo -a 20200731 | wc -l
# Have pmdiff point out ’significant peaks’ in archives:
pmdiff -a <archivename>

# Accessing metrics
# Most basic access to metrics:
pmrep -a <archivename> <metric>
pmrep -a 20200731 kernel.all.load
# Graphical access:

Install PCP on clients, so they offer data for a collector

yum -y install pcp
firewall-cmd –permanent –zone=public –add-port=44321/tcp
firewall-cmd –reload

if grep -q PMCD_LOCAL /etc/sysconfig/pmcd; then
  sed -ie ’s,PMCD_LOCAL.*,PMCD_LOCAL=0,’ /etc/sysconfig/pmcd
  echo ’PMCD_LOCAL=0’ »/etc/sysconfig/pmcd
grep PMCD_LOCAL /etc/sysconfig/pmcd
service pmcd restart
chkconfig pmcd on

Have PCP collect data from remote systems

On the collector, we install pcp-zeroconf which also sets up logging to archive files. We then set variable CLIENT to the clients name, create a config- and controlfile, and notify pmlogger of the changes.

yum -y install pcp-zeroconf
/usr/libexec/pcp/bin/pmlogconf \
# optionally, execute the last command a second time
echo "$CLIENT.local n n PCP_LOG_DIR/pmlogger/$CLIENT.local" \
  " -r -T30d -c config.$CLIENT" \
# Not have pmlogger perform the first data collection

PCP dstat usage

# default dstat output, list plugins, customize output
pcp dstat
pcp dstat --list
pcp dstat --time --disk --cpu
pcp dstat -c -C 0,3,total
pcp dstat 10  # subsampling, 10sec
pcp dstat -n -N enp0s31f6,redhat0

# dstat archive access
pmdumplog -l $ARCHIVE # log is from when, till when?
pcp --archive $ARCHIVE --start @10:30 dstat 10 5
pcp --archive $ARCHIVE --start @10:30 dstat --time 10 5

# how much traffic was there at midnight on my interface?
pcp --archive $ARCHIVE --start @0:00 dstat --time 60 30 -n -N ens3,lo

# dstat plugins
pcp dstat --redis
cat /etc/pcp/dstat/redis
pminfo redis
mkdir ~/.pcp/dstat
cp /etc/pcp/dstat/redis ~/.pcp/dstat/redis-extra
pcp dstat --list
pcp dstat --refis-extra
software/performance_co-pilot/pcp-cheat-sheet.txt · Last modified: 2021/03/23 12:22 (external edit)