Skip to content

How to get openwebrx stats into collectd

Jakob Ketterl edited this page Sep 30, 2021 · 15 revisions

Collectd is a nifty little tool; it collects various bits and pieces of information all around your system in intervals so you can make nice little charts out of it. You can use the openwebrx status interface to get some stats about openwebrx, too, using the curl_json plugin:

pi@sdr10:~ $ cat /etc/collectd/collectd.conf.d/openwebrx.conf 
LoadPlugin curl_json

<Plugin curl_json>
  <URL "http://localhost:8073/metrics.json">
    Plugin "openwebrx_decodes"
    <Key "wsjt/decodes/*/*/count">
      Type "counter"
    </Key>
    <Key "aprs/decodes/*/*/*/count">
      Type "counter"
    </Key>
    <Key "digiham/decodes/*/*/count">
      Type "counter"
    </Key>
    <Key "js8call/decodes/*/*/count">
      Type "counter"
    </Key>
    <Key "decoding/queue/*/count">
      Type "counter"
    </Key>
    <Key "decoding/queue/length">
      Type "gauge"
    </Key>
    <Key "pskreporter/*/count">
      Type "gauge"
    </Key>
    <Key "wsprnet/*/count">
      Type "gauge"
    </Key>
    <Key "openwebrx/users">
      Type "gauge"
    </Key>
  </URL>
</Plugin>

Collectd 5.9

The version of collectd included in Raspbian Stretch does not support setting the "Plugin" directive, which leads to all data ending up in a rather generic "curl_json" measurement when used together with InfluxDB. This was fixed in collectd 5.9. Here's some quick instructions on how to build it:

Install dependencies

sudo apt-get build-dep collectd

Check out the source from github

Initialize the configure script:

libtoolize --force
aclocal
autoheader
automake --force-missing --add-missing
autoconf
./configure

Configure:

./configure -prefix=/usr --sysconfdir=/etc --mandir=/usr/share/man --localstatedir=/var --enable-all-plugins CPPFLAGS="-UCONFIGFILE -DCONFIGFILE='\"/etc/collectd/collectd.conf\"'"

Build and install:

make
sudo make install
Clone this wiki locally