Centos 7 - RRDCached

<%- if @topic_view.topic.tags.present? %>
<%= t 'js.tagging.tags' %>: <%- @topic_view.topic.tags.each do |t| %> <%= t %> <%- end %>
<% end %>

Hello,

I can’t seem to get rrdcached running on my Centos7 box. I currently have mariadb running on a separate box and am simply trying to get rrdcached running on the web front end after updating to 1.7.0. I followed the instructions that user Rick posted here: Distributed Poller not working. More Specifically I did this:

As root:

rpm -e rrdtool rrdtool-devel rrdtool-perl
cd /opt ; wget https://oss.oetiker.ch/rrdtool/pub/rrdtool-1.7.0.tar.gz
tar xvfz rrdtool-1.7.0.tar.gz
cd rrdtool-1.7.0
./configure
make ; make install
ln -s /opt/rrdtool-1.7.0/bin/rrdcached /usr/bin/rrdcached
ln -s /opt/rrdtool-1.7.0/bin/rrdtool rrdtool
ln -s /opt/rrdtool-1.7.0/bin/rrdcreate rrdcreate
ln -s /opt/rrdtool-1.7.0/bin/rrdupdate rrdupdate
ln -s /opt/rrdtool-1.7.0/bin/rrdcgi rrdcgi

cd /usr/bin

ln -s /opt/rrdtool-1.7.0/bin/rrdcached rrdcached
ln -s /opt/rrdtool-1.7.0/bin/rrdtool rrdtool
ln -s /opt/rrdtool-1.7.0/bin/rrdcreate rrdcreate
ln -s /opt/rrdtool-1.7.0/bin/rrdupdate rrdupdate
ln -s /opt/rrdtool-1.7.0/bin/rrdcgi rrdcgi

I created the /etc/systemd/system/rrdcached.service file per the instructions here: https://docs.librenms.org/Extensions/RRDCached/

I then ran validate.php:

[[email protected] etc]# sudo su librenms
bash-4.2$ cd /opt/librenms
bash-4.2$ ./validate.php

Component Version
LibreNMS 1.54-64-ga0ba412
DB Schema 2019_07_09_150217_update_users_widgets_settings (140)
PHP 7.2.21
MySQL 5.5.60-MariaDB
RRDTool 1.7.0
SNMP NET-SNMP 5.7.2

====================================

[OK] Composer Version: 1.9.0
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database schema correct

Before uncommenting “$config[‘rrdcached’] = “unix:/var/run/rrdcached.sock”;” in config.php I verified that graphs were still being drawn. Based on what I’ve read I need to make sure that the rrdcached service will start and then I can point my distributed pollers at the address/port running the service. However, I can’t seem to get it to start properly.

Attempting to start it results in the following output from “systemctl status rrdcached”

[[email protected] etc]# systemctl status rrdcached
● rrdcached.service - Data caching daemon for rrdtool
Loaded: loaded (/etc/systemd/system/rrdcached.service; enabled; vendor preset: disabled)
Active: failed (Result: timeout) since Fri 2019-08-30 09:21:32 PDT; 23min ago
Process: 17760 ExecStart=/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)
Main PID: 1986 (code=exited, status=0/SUCCESS)

Aug 30 09:20:01 lab-nms-web0.lab systemd[1]: Starting Data caching daemon for rrdtool…
Aug 30 09:20:01 lab-nms-web0.lab systemd[1]: PID file /run/rrdcached.pid not readable (yet?) after start.
Aug 30 09:21:32 lab-nms-web0.lab systemd[1]: rrdcached.service start operation timed out. Terminating.
Aug 30 09:21:32 lab-nms-web0.lab systemd[1]: Failed to start Data caching daemon for rrdtool.
Aug 30 09:21:32 lab-nms-web0.lab systemd[1]: Unit rrdcached.service entered failed state.
Aug 30 09:21:32 lab-nms-web0.lab systemd[1]: rrdcached.service failed.

And this output from journalctl -xe:

Aug 30 09:21:32 lab-nms-web0.lab systemd[1]: rrdcached.service start operation timed out. Terminating.
Aug 30 09:21:32 lab-nms-web0.lab systemd[1]: Failed to start Data caching daemon for rrdtool.
– Subject: Unit rrdcached.service has failed
– Defined-By: systemd
– Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

– Unit rrdcached.service has failed.

– The result is failed.
Aug 30 09:21:32 lab-nms-web0.lab.l systemd[1]: Unit rrdcached.service entered failed state.
Aug 30 09:21:32 lab-nms-web0.lab. systemd[1]: rrdcached.service failed.
Aug 30 09:21:32 lab-nms-web0.lab. polkitd[546]: Unregistered Authentication Agent for unix-process:17750:59003280 (system bus name :1.36739, object path /org/freedesktop/PolicyKit1/Authent
Aug 30 09:22:01 lab-nms-web0.lab. systemd[1]: Created slice User Slice of librenms.

After doing some digging I came across this post: RRDCached CENTOS 7 which determined that rrdcached wasn’t located in /usr/bin/ as the service definition file suggested.

In my case the output of ‘which rrdcached’ returned ‘/bin/rrdcached’ but updating the service definition file with this path didn’t resolve the issue.

I’ve also tried temporarily disabling SELinux but don’t see any change in the log output.

Does anyone have any other suggestions?
Thanks in advance.

Trying to set up a Centos 7 Instance here and hitting exactly the same thing - did anyone manage to resolve this issue?

I missed this the first time - these are my notes for our Centos 7 install which is working fine. HTH.

RRDCached installation CentOS 7

This example is based on a fresh LibreNMS install, on a minimal CentOS 7.x installation.

Install the EPEL and update the repos and RRDtool.

sudo yum install epel-release
sudo yum update
sudo yum update rrdtool

Create the needed directories, set ownership and permissions.

sudo mkdir /var/run/rrdcached
sudo chown librenms:librenms /var/run/rrdcached
sudo chmod 755 /var/run/rrdcached

Create an rrdcached service for easy daemon management.

sudo touch /etc/systemd/system/rrdcached.service

Edit rrdcached.service and paste the example config:

[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 -B -R -j /var/tmp -l unix:/var/run/rrdcached/rrdcached.sock -t 4 -F -b /data/librenms/rrd/

[Install]
WantedBy=default.target

Reload the systemd unit files from disk, so it can recognize the newly created rrdcached.service. Enable the rrdcached.service on boot and start the service.

sudo systemctl daemon-reload
sudo systemctl enable --now rrdcached.service
sudo systemctl restart rrdcached
sudo systemctl status rrdcached.service

Edit /opt/librenms/config.php to include:

$config['rrdcached'] = "unix:/var/run/rrdcached/rrdcached.sock";

Check to see if the graphs are being drawn in LibreNMS. This might take a few minutes. After at least one poll cycle (5 mins), check the LibreNMS disk I/O performance delta. Disk I/O can be found under the menu Devices>All Devices>[localhost hostname]>Health>Disk I/O.

Depending on many factors, you should see the Ops/sec drop by ~30-40%.

To check if rrdcached is working:

sudo yum install socat

then:

while true; do clear ; echo STATS | sudo socat - /var/run/rrdcached/rrdcached.sock; sleep 1; done

Thanks for that -

In the interim I actually found a ‘fix’ - although i’m keen to hear if anything adverse will come of it

I simply commented out PIDFile=/run/rrdcached.pid in the service file and it ran fine after that, which is strange, I assume it must of defaulted back to something else

edit 1 # This is now working and populating graphing btw

The rrdcached docs (https://oss.oetiker.ch/rrdtool/doc/rrdcached.en.html) state that if not specified, the default, $localstatedir/run/rrdcached.pid will be used.

cheers

Just incase anyone wonders whether it is worth implementing rrdcached…you can see the difference it made to my IO here
image

1 Like