{"id":4799,"date":"2023-02-04T16:30:33","date_gmt":"2023-02-04T22:30:33","guid":{"rendered":"https:\/\/www.incredigeek.com\/home\/?p=4799"},"modified":"2024-02-06T17:04:59","modified_gmt":"2024-02-06T23:04:59","slug":"setting-up-rrdrest-on-centos-8-or-almalinux-9","status":"publish","type":"post","link":"https:\/\/www.incredigeek.com\/home\/setting-up-rrdrest-on-centos-8-or-almalinux-9\/","title":{"rendered":"Setting up RRDReST on CentOS 8 or AlmaLinux 9"},"content":{"rendered":"\n<p>There are some differences on setting up RRDReST on CentOS 8, Almalinux 9 vs CentOS 7<\/p>\n\n\n\n<p>If you are setting this up to use with LibreNMS and Grafana, check out the rest of the this article.  <a href=\"https:\/\/www.incredigeek.com\/home\/setting-up-graphana-on-librenms\/\">https:\/\/www.incredigeek.com\/home\/setting-up-grafana-on-librenms\/<\/a><\/p>\n\n\n\n<p><\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Installing RRDReST<\/h1>\n\n\n\n<p>All the docker commands have been swapped out for podman.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Install Docker<\/li>\n\n\n\n<li>Create a compose file<\/li>\n\n\n\n<li>Run compose file to create container<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Install docker<\/h2>\n\n\n\n<p>Podman is default on CentOS 8 and later and is, for the most part, a drop in replacement for Docker.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo yum install -y podman podman-compose\nsudo systemctl enable podman<\/pre>\n\n\n\n<p>Create a Podman \/ Docker network to use.  We&#8217;ll use this to assign a static IP address to the container.  We&#8217;ll call the network rrdnet, and we&#8217;ll use the 10.89.2.0\/24 range.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo podman network create --subnet=10.89.2.0\/24 rrdnet<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Create podman-compose file<\/h2>\n\n\n\n<p>Create a docker compose file<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">vi podman-compose.yml<\/pre>\n\n\n\n<p>Add the following<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">version: \"3.5\"\nservices:\n  rrdrest:\n    image: michaelwadman\/rrdrest:latest\n    container_name: rrdrest\n    restart: always\n    volumes:\n      - \"\/opt\/librenms\/rrd:\/opt\/librenms\/rrd:Z\"\n    environment:\n      - TZ=America\/Denver\n    networks:\n      rrdnet:\n        ipv4_address: 10.89.2.2\n        ipam:\n          driver: default\n          config:\n            - subnet: 10.89.2.0\/24\nnetworks:\n  rrdnet:\n    external: true<\/pre>\n\n\n\n<p>Change the TZ to your time zone. If you have issues with the graphs, most likely something is off with the time zone between this container and Grafana\/LibreNMS server<\/p>\n\n\n\n<p>Note that the :Z is needed for SELinux to allow RRDReST to access the sub folders.  AKA. the rrd files.<\/p>\n\n\n\n<p>The container should have a 10.89.2.2 IP address.  You can take all the networking sections out, and the container will receive DHCP.  The problem is that the IP can change, breaking our graphs in Grafana.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Run RRDReST Container<\/h2>\n\n\n\n<p>Save the file.  Then start and setup the container with<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo podman-compose up -d<\/pre>\n\n\n\n<p>You will need your docker container IP address to setup the connection in Grafana.  <em>If you used the above docker-compose config, then it should be 10.89.2.2.<\/em><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo docker exec -it rrdrest ip addr | grep eth0<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Configure RRDRest to start on system boot with systemd<\/h2>\n\n\n\n<p>The &#8220;restart: always&#8221; option does not appear to work on systems with podman.  We can create a systemd service instead.<\/p>\n\n\n\n<p>Use the following command to automatically create a systemd file.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo podman generate systemd rrdrest<\/pre>\n\n\n\n<p>Copy the contents to a new file in \/etc\/systemd\/system\/<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/etc\/systemd\/system\/rrdrest.service<\/pre>\n\n\n\n<p><em>If you end up deleting the rrdrest container, you&#8217;ll need to update the systemd file again.  You may need also need to run &#8220;systemctl daemon-reload&#8221;<\/em><\/p>\n\n\n\n<p>Enable the new service with<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">systemctl enable rrdrest<\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>Congratulations. RRDReST is now setup and running.<\/p>\n\n\n\n<p>You can verify it&#8217;s running by checking with Podman \/ Docker.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo podman ps<\/pre>\n\n\n\n<p>You can also ping it<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ping 10.89.2.2<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>There are some differences on setting up RRDReST on CentOS 8, Almalinux 9 vs CentOS 7 If you are setting this up to use with LibreNMS and Grafana, check out the rest of the this article. https:\/\/www.incredigeek.com\/home\/setting-up-grafana-on-librenms\/ Installing RRDReST All &hellip; <a href=\"https:\/\/www.incredigeek.com\/home\/setting-up-rrdrest-on-centos-8-or-almalinux-9\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[352,3],"tags":[1286,246,1639,619,353,128,389,1398,1285,50],"class_list":["post-4799","post","type-post","status-publish","format-standard","hentry","category-librenms","category-linux","tag-api","tag-docker","tag-docker-compose","tag-ip","tag-librenms","tag-networking-2","tag-nms","tag-podman","tag-rrdrest","tag-static-ip"],"_links":{"self":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/4799","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/comments?post=4799"}],"version-history":[{"count":14,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/4799\/revisions"}],"predecessor-version":[{"id":5610,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/4799\/revisions\/5610"}],"wp:attachment":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/media?parent=4799"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/categories?post=4799"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/tags?post=4799"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}