Site Tools


Sidebar

software:performance_co-pilot:openmetrics-smokeping

What's here?

https://oss.oetiker.ch/smokeping/ exists, I wanted to create something like it but with PCP as backend.

$ cat /var/lib/pcp/pmdas/openmetrics/config.d/smokeping.sh
#!/bin/bash

function smokeping {
        for i in $(ping -c1 $REMOTE |grep icmp_seq|sed -e 's,.* time=,,' -e 's, ms$,,'); do
                echo "$REMOTE {var=\"latency\"} $i";
        done
}


for REMOTE in fluxcoil.net ipv6.fluxcoil.net www.heise.de \
  ftp.NetBSD.org global.jaxa.jp ftp2.jp.NetBSD.org; do
        smokeping;
done
$ chmod +x /var/lib/pcp/pmdas/openmetrics/config.d/smokeping.sh

Then add it to the pmlogger conf /var/lib/pcp/config/pmlogger/config.default:

[...]
# DO NOT UPDATE THE FILE ABOVE THIS LINE
# Otherwise any changes may be lost the next time pmlogconf is
# used on this file.
#
# It is safe to make additions from here on ...
#
log advisory on every 5 min {
        openmetrics.smokeping
}

Then restart pmlogger, and verify smokeping is getting archived:

$ systemctl restart pmlogger
$ pcp
Performance Co-Pilot configuration on fluxcoil:

 platform: Linux fluxcoil 4.19.0-16-amd64 #1 SMP Debian 4.19.181-1 (2021-03-19) x86_64
 hardware: 4 cpus, 1 disk, 1 node, 16042MB RAM
 timezone: CEST-2
 services: pmcd pmproxy
     pmcd: Version 5.3.1-1, 15 agents, 1 client
     pmda: root pmcd proc pmproxy xfs bind2 linux mmv kvm postfix rsyslog
           nginx jbd2 openmetrics netcheck
 pmlogger: primary logger: /var/log/pcp/pmlogger/fluxcoil/20210516.07.24
$ pmrep -a /var/log/pcp/pmlogger/fluxcoil/20210516.07.24 openmetrics.smokeping
[...]
      158.000      0.044        0.018       3.990     218.000        261.000
      158.000      0.044        0.018       3.990     218.000        261.000
      158.000      0.044        0.018       3.990     218.000        261.000
      158.000      0.044        0.018       3.990     218.000        261.000
      158.000      0.044        0.018       3.990     218.000        261.000

Then you can visualize the archived data with grafana, using a heat diagram.

software/performance_co-pilot/openmetrics-smokeping.txt ยท Last modified: 2022/11/13 12:06 by 127.0.0.1