| 1 |
[[feature-pcp]] |
| 2 |
= PCP Metrics |
| 3 |
|
| 4 |
If available, Cockpit uses the https://pcp.io/[Performance Co-Pilot] |
| 5 |
framework to gather metrics data about the system. This data is used to |
| 6 |
display the history graphs on the "Metrics and history" page. Cockpit |
| 7 |
can use the PCP logging feature to display archived data about the |
| 8 |
system from a different point in time. If PCP is not available, then |
| 9 |
Cockpit gathers the metrics data itself, but archival features are not |
| 10 |
available. |
| 11 |
|
| 12 |
Whether or not metrics are archived depends on whether the |
| 13 |
https://linux.die.net/man/1/pmlogger[`+pmlogger.service+`] systemd unit |
| 14 |
is running or not. The "Enable PCP metrics collector" button on the |
| 15 |
Metrics page will enable and start this service. |
| 16 |
|
| 17 |
To see similar metrics data from the command line, you can use tools |
| 18 |
like https://linux.die.net/man/1/pmstat[`+pmstat+`] or |
| 19 |
https://linux.die.net/man/1/pminfo[`+pminfo+`]: |
| 20 |
|
| 21 |
.... |
| 22 |
$ pmstat |
| 23 |
@ Sat Sep 26 15:30:10 2015 |
| 24 |
loadavg memory swap io system cpu |
| 25 |
1 min swpd free buff cache pi po bi bo in cs us sy id |
| 26 |
4.19 0 20710m 605148 6450m 0 0 0 2548 5688 14K 19 3 76 |
| 27 |
... |
| 28 |
.... |
| 29 |
|
| 30 |
These metrics can also be exposed to other machines on a TCP port with |
| 31 |
https://linux.die.net/man/1/pmproxy[pmproxy] and |
| 32 |
https://redis.io/[Redis] or https://valkey.io/[Valkey]: |
| 33 |
|
| 34 |
.... |
| 35 |
systemctl enable --now redis pmproxy |
| 36 |
# if you use firewalld, open port 44322: |
| 37 |
firewall-cmd --permanent --add-service pmproxy |
| 38 |
firewall-cmd --reload |
| 39 |
.... |
| 40 |
|
| 41 |
This allows you to gather and visualize PCP metrics from multiple |
| 42 |
machines with https://grafana.com/[Grafana] and the |
| 43 |
https://grafana-pcp.readthedocs.io[PCP Grafana plugin]. |