https://blog.facette.io/

Monitor OpenBSD using Collectd and Facette

Imil wrote as nice 5 minutes collectd + facette setup article using NetBSD. After a quick look in the ports, I saw it was possible to monitor OpenBSD using Collectd and Facette too. Hang tight, it only takes seconds to achieve.

Grab the metrics using Collectd

# pkg_add collectd-rrdtool collectd-mysql

# vi /etc/collectd.conf
(...)
BaseDir "/var/collectd"
PIDFile "/var/collectd/collectd.pid"
TypesDB "/usr/local/share/collectd/types.db"

# rcctl enable collectd
# rcctl start collectd

Render the metrics using Facette

# pkg_add facette

# vi /etc/facette/facette.json
{
  "bind": "127.0.0.1:12003",
(...)

# vi /etc/facette/providers/collectd.json
{
  "connector": {
    "type": "rrd",
    "path": "/var/collectd/rrd",
    "pattern": "(?P<source>[^/]+)/(?P<metric>.+).rrd"
  },
(...)

# rcctl enable facette
# rcctl start facette

Wait a few minutes and browse the GUI.

6 Comments

  • Matthew Herzog Sun, 04 Mar 2018 01:40:39 +0000 Reply

    I end up with a rrd data dir called /var/collectd/rrd/Not Set containing all my .rrd files and plugin directories.
    My collectd.conf looks like:
    BaseDir “/var/collectd”
    PIDFile “/var/collectd/collectd.pid”
    #PluginDir “${exec_prefix}/lib/collectd”
    PluginDir “/usr/local/lib/collectd”
    TypesDB “/usr/local/share/collectd/types.db”
    Why is “Not Set” being created?

  • Matthew Herzog Sun, 04 Mar 2018 01:43:07 +0000 Reply

    bash-4.4# pwd
    /var/collectd/rrd/Not Set
    ls -la
    total 68
    drwxr-xr-x 17 root _collectd 512 Mar 4 00:38 .
    drwxr-xr-x 3 root _collectd 512 Mar 4 00:38 ..
    drwxr-xr-x 2 root _collectd 512 Mar 4 00:38 collectd-cache
    drwxr-xr-x 2 root _collectd 512 Mar 4 00:38 collectd-write_queue
    drwxr-xr-x 2 root _collectd 512 Mar 4 00:38 cpu-0
    drwxr-xr-x 2 root _collectd 512 Mar 4 00:38 disk-cd0
    drwxr-xr-x 2 root _collectd 512 Mar 4 00:38 disk-wd0
    drwxr-xr-x 2 root _collectd 512 Mar 4 00:38 interface-em0
    drwxr-xr-x 2 root _collectd 512 Mar 4 00:38 interface-fxp0
    drwxr-xr-x 2 root _collectd 512 Mar 4 00:38 load
    drwxr-xr-x 2 root _collectd 512 Mar 4 00:38 memory
    drwxr-xr-x 2 root _collectd 512 Mar 4 00:38 ping
    drwxr-xr-x 2 root _collectd 512 Mar 4 00:38 processes
    drwxr-xr-x 2 root _collectd 512 Mar 4 00:38 processes-name
    drwxr-xr-x 2 root _collectd 512 Mar 4 00:38 swap
    drwxr-xr-x 2 root _collectd 512 Mar 4 00:38 uptime
    drwxr-xr-x 2 root _collectd 512 Mar 4 00:38 users

  • Matthew Herzog Sun, 04 Mar 2018 02:04:14 +0000 Reply

    DataDir “/var/collectd/rrd”
    CreateFilesAsync false
    CacheTimeout 120
    CacheFlush 900
    WritesPerSecond 50

  • Matthew Herzog Sun, 04 Mar 2018 18:49:20 +0000 Reply

    It seems the package has been compiled to expect /var/lib which did not exist in OpenBSD 6.2.
    mkdir /var/lib then reinstall collectd and voila, the “Not Set/” problem goes away.
    Now Facette can see Origins, Sources and Metrics even without me adjusting the paths in /etc/facette/providers/collectd.json.

  • Matthew Herzog Tue, 13 Mar 2018 01:50:52 +0000 Reply

    Hello. The official docs say the main config file is a YAML file. https://docs.facette.io/latest/configuration/

    • Joel Carnat Tue, 13 Mar 2018 08:19:49 +0000 Reply Author

      I used Facette 0.3.
      Docs is « latest » which may not be the same.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

%d bloggers like this: