RRDcached not refreshing

I’ve performed a clean install of libreNMS on Ubuntu 22.04
I’ve then migrated the database over from a libreNMS Centos 7 install and copied over rrd files.

Unfortunately the rrd files don’t appear to be getting updated when I enable rrdcached. Note. Disabling rrdcached and everything is OK.

Running poller.php on a device doesn’t rectify this either. If I erase rrd/DEVICE folder then run poller.php on said device, it will create the folder and files. However, it doesn’t continue to update. Similar happens if I add a new device.

Polling is definitely happening as device alerts etc are updating.

I’ve set permissions and confirmed.

chown -R librenms:librenms /opt/librenms
chmod 771 /opt/librenms
setfacl -d -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
setfacl -R -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
chown librenms:librenms /var/lib/rrdcached/journal/

Am I missing something obvious?

librenms@librenms:~$ ./validate.php

Component Version
LibreNMS 23.2.0-43-gae429d987 (2023-03-22T01:31:42+13:00)
DB Schema 2023_03_14_130653_migrate_empty_user_funcs_to_null (249)
PHP 8.1.2
Python 3.10.4
Database MariaDB 10.6.7-MariaDB-2ubuntu1
RRDTool 1.7.2
SNMP 5.9.1
===========================================

[OK] Composer Version: 2.5.4
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database Schema is current
[OK] SQL Server meets minimum requirements
[OK] lower_case_table_names is enabled
[OK] MySQL engine is optimal
[OK] Database and column collations are correct
[OK] Database schema correct
[OK] MySQl and PHP time match
[OK] Active pollers found
[OK] Dispatcher Service not detected
[OK] Locks are functional
[OK] Python poller wrapper is polling
[OK] Redis is unavailable
[OK] rrdtool version ok
[OK] Connected to rrdcached
librenms@librenms:~$

config.php

<?php
## Have a look in defaults.inc.php for examples of settings you can set here. DO NOT EDIT defaults.inc.php!

### Database config
$config['db_host'] = 'localhost';
$config['db_user'] = 'librenms';
$config['db_pass'] = 'XXXXXXXXXXXX';
$config['db_name'] = 'librenms';
$config['db']['extension'] = "mysqli";// mysql or mysqli

// This is the user LibreNMS will run as
//Please ensure this user is created and has the correct permissions to your install
$config['user'] = 'librenms';

### Memcached config - We use this to store realtime usage
$config['memcached']['enable']  = FALSE;
$config['memcached']['host']    = "localhost";
$config['memcached']['port']    = 11211;

### Locations - it is recommended to keep the default
$config['install_dir']  = "/opt/librenms";

### This should *only* be set if you want to *force* a particular hostname/port
### It will prevent the web interface being usable form any other hostname
#$config['base_url']        = "http://librenms.company.com";

### Enable this to use rrdcached. Be sure rrd_dir is within the rrdcached dir
### and that your web server has permission to talk to rrdcached.
$config['rrdcached']    = "unix:/run/rrdcached.sock";

### Default community
$config['snmp']['community'] = array("public");
$config['autodiscovery']['xdp']            = TRUE;

### Authentication Model
$config['auth_mechanism'] = "mysql"; # default, other options: ldap, http-auth
#$config['http_auth_guest'] = "guest"; # remember to configure this user if you 

### List of RFC1918 networks to allow scanning-based discovery
#$config['nets'][] = "10.0.0.0/8";
#$config['nets'][] = "172.16.160.0/20";

# following is necessary for poller-wrapper
# poller-wrapper is released public domain
$config['poller-wrapper']['alerter'] = FALSE;
# Uncomment the next line to disable daily updates
#$config['update'] = 0;

#useful as we don't have dns records for most
$config['force_ip_to_sysname'] = true;

#ignore mikrotik  WDS clients
$config['bad_if_regexp'][] = '/^wds[0-9]/';


$config['snmp']['timeout'] = 2;            # timeout in seconds
$config['snmp']['retries'] = 5;            # how many times to retry the query
$config['fping_options']['retries'] = 5;
$config['fping_options']['timeout'] = 1000;

$config['poller_modules']['ipmi'] = 0;
$config['poller_modules']['ospf'] = 0;
$config['poller_modules']['applications'] = 0;
$config['poller_modules']['mpls'] = 0;

/etc/default/rrdcached

# Where database files are placed.  If left unset, the default /tmp will
# be used.  NB: The daemon will reject a directory that has symlinks as
# components.  NB: You may want to have -B in BASE_OPTS.
#BASE_PATH=/var/lib/rrdcached/db/
BASE_PATH=/opt/librenms/rrd/


# Where journal files are placed.  If left unset, journaling will
# be disabled.
#JOURNAL_PATH=/var/lib/rrdcached/journal/
JOURNAL_PATH=/var/lib/rrdcached/journal

# FHS standard placement for process ID file.
#PIDFILE=/var/run/rrdcached.pid
PIDFILE=/run/rrdcached.pid

# FHS standard placement for local control socket.
#SOCKFILE=/var/run/rrdcached.sock
SOCKFILE=/run/rrdcached.sock

# Optional override group that should own/access the local control
# socket
#SOCKGROUP=root

# Optional override access mode of local control socket.
#SOCKMODE=0660

# Optional unprivileged group to run under when daemon.  If unset
# retains invocation group privileges.
#DAEMON_GROUP=_rrdcached
DAEMON_GROUP=librenms
# Optional unprivileged user to run under when daemon.  If unset
# retains invocation user privileges.
#DAEMON_USER=_rrdcached
DAEMON_USER=librenms

# Network socket address requests.  Use in conjunction with SOCKFILE to
# also listen on INET domain sockets.  The option is a lower-case ell
# ASCII 108 = 0x6c, and should be repeated for each address.  The
# parameter is an optional IP address, followed by an optional port with
# a colon separating it from the address.  The empty string is
# interpreted as "open sockets on the default port on all available
# interfaces", but generally does not pass through init script functions
# so use -L with no parameters for that configuration.
#NETWORK_OPTIONS="-L"

# Any other options not specifically supported by the script (-P, -f,
# -F, -B).
#BASE_OPTIONS="-B"
BASE_OPTIONS="-B -F -R"

poller results
https://p.libren.ms/view/9b008a78

Perhaps check the journal files ownership? and/or set? (-R ie recursive)

chown -R librenms:librenms /var/lib/rrdcached/journal/

perhaps set your SOCKGROUP to the group your librenms install runs as?
and/or depending on your pain threshold set SOCKMODE=0666 (ie anyone can write to the socket?)

I guess if that doesn’t work you could run rrdcached in the foreground and crank up some logging?

Journal files ownership was set OK.
chmod 666 on rrdcached.pid and rrdcached.sock

Same result I’m afraid.

I’m sorry, I’ve no idea how to run rrdcached in the foreground etc.

SOCKGROUP set to your librenms user ?

Well spotted. That sorted it. Thanks!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.