RRDCached CENTOS 7

Hello,

I’m trying to do the optimization part relating to RRDCached but can’t make it work.
I followed this : https://docs.librenms.org/#Extensions/RRDCached/#rrdcached-installation-centos-7
But when I try to start RRDCached i get the following error :

    Job for rrdcached.service failed because the control process exited with error code. See "systemctl status rrdcached.service" and "journalctl -xe" for details.

Then “systemctl status rrdcached.service” returns me this:

rrdcached.service - Data caching daemon for rrdtool
Loaded: loaded (/etc/systemd/system/rrdcached.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since dim. 2018-05-06 10:53:15 CEST; 3min 11s ago
Process: 29309 ExecStart=/usr/bin/rrdcached -w 1800 -z 1800 -f 3600 -s librenms -U librenms -G librenms -B -R -j /var/tmp -l unix:/run/rrdcached.sock -t 4 -F -b /opt/librenms/rrd/ (code=exited, status=203/EXEC)

And then journalctl -xe:

-- Subject: L'unité (unit) rrdcached.service a commencé à démarrer
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- L'unité (unit) rrdcached.service a commencé à démarrer.
mai 06 11:00:11 srv-monitoring.fr systemd[371]: Failed at step EXEC spawning /usr/bin/rrdcached: No such file or directory
-- Subject: Le processus /usr/bin/rrdcached n'a pas pu être exécuté
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Le processus /usr/bin/rrdcached n'a pas pu être exécuté, et a donc échoué.
--
-- Le code d'erreur renvoyé est 2.
mai 06 11:00:11 srv-monitoring.fr systemd[1]: rrdcached.service: control process exited, code=exited status=203
mai 06 11:00:11 srv-monitoring.fr systemd[1]: Failed to start Data caching daemon for rrdtool.
-- Subject: L'unité (unit) rrdcached.service a échoué
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- L'unité (unit) rrdcached.service a échoué, avec le résultat failed.
mai 06 11:00:11 srv-monitoring.fr systemd[1]: Unit rrdcached.service entered failed state.
mai 06 11:00:11 srv-monitoring.fr systemd[1]: rrdcached.service failed.
mai 06 11:00:11 srv-monitoring.fr polkitd[684]: Unregistered Authentication Agent for unix-process:352:173526291 (system bus name :1.84922, object path
lines 2372-2416/2416 (END)

Does anyone have a solution for this ?
Thanks in advance for any help.

Hi!

What do you have in the service definition file ?

I have this (I changed the socket location to /run but else all is the default except the location of LibreNMS) ?

[Unit]
Description=Data caching daemon for rrdtool
After=network.service

[Service]
Type=forking
PIDFile=/run/rrdcached.pid
ExecStart=/usr/bin/rrdcached -w 1800 -z 1800 -f 3600 -s librenms -U librenms -G librenms -R -j /var/tmp -l unix:/run/rrdcached.sock -t 4 -F -b /data/librenms/rrd/

[Install]
WantedBy=default.target

You also need to enable it in the LibreNMS config.php file :

[librenms@ssfns-sds-server-1 ~]$ grep rrdcached /data/librenms/config.php
### 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"; 

Finally as the config file says, you need to ensure the webserver user can access the data.

The default rrdtool is only 1.4 on CentOS-7 so some of the new features are not present. To get those you need to upgrade to >=1.5.

/Jesper

Btw. in the log you posted, there’s this error line:

Failed at step EXEC spawning /usr/bin/rrdcached: No such file or directory

Looks like you do not have rrdcached installed, or maybe in a different location ?

/Jesper

Thank you so much for your time and your answers, especially the last one which led me to find out what was wrong.

Typing “which rrdcached” returned me the following path “/usr/sbin/rrdcached”
So I changed “ExecStart=/usr/bin/rrdcached” in “/etc/systemd/system/rrdcached.service” with the path mentionned above.

And now it seems to work fine.

Thanks again and hope you have a nice day,

1 Like

:pray: I signed up to say thanks, this solved the issue for me as well.

““Typing “which rrdcached” returned me the following path “/usr/sbin/rrdcached”
So I changed “ExecStart=/usr/bin/rrdcached” in “/etc/systemd/system/rrdcached.service” with the path mentionned above.””

now typing

systemctl status rrdcached.service

returns
● rrdcached.service - Data caching daemon for rrdtool
Loaded: loaded (/etc/systemd/system/rrdcached.service; enabled; vendor preset: disabled)
Active: active (running) since Sat 2018-09-01 12:58:57 AEST; 3min 49s ago
Process: 127874 ExecStart=/usr/bin/rrdcached -w 1800 -z 1800 -f 3600 -s librenms -U librenms -G librenms -B -R -j /var/tmp -l unix:/run/rrdcached.sock -t 4 -F -b /opt/librenms/rrd/ (code=exited, status=0/SUCCESS)
etc…