Report this

What is the reason for this report?

How about OpenWRT and Collectd on DO droplet?

Posted on January 5, 2018

Hi all I’m sure there is a simpler way, through my DO droplet to do what I’m doing-so hopefully some bright person can help! I currently have a few OpenWRT nodes, talking back to a master OpenWRT router-both run the Collectd package, and combined with the luci-app-statistics package, I have a central repository for monitoring ping, server load etc. As its bulit in Luci, the main GUI for OpenWRT, its very simple to set up.

Is there a way to use my DO droplet (running Debian) to act as the central repositry-and combined with the public facing interface, be accessible to others to see the graphs? As running a fully fledged router, only to get the stats from collectd, seems overkill. I suspect you can run colledtd/RRDtool/some form of webserver to do all of this, I just need some pointers :-)

Cheers cabs



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hello,

Yes, I believe this should be doable. You should be able to configure your DigitalOcean Droplet to act as a central repository for your OpenWRT Collectd data.

You can install Collectd, a web server and a tool for visualizing the Collectd data on your droplet. You can follow the steps on how to install this on the official GitHub repository here:

https://github.com/collectd/collectd/

Or here’s also a high-level guide on how to achieve this.

1. Install Collectd:

On your Debian-based droplet, you can install Collectd with the following command:

sudo apt-get update
sudo apt-get install collectd

2. Configure Collectd:

You would then need to configure Collectd to run in server mode, which can be done by modifying the configuration file typically located at /etc/collectd/collectd.conf. Here’s an example configuration to set up a simple server:

Hostname    "your_hostname"
FQDNLookup   true
BaseDir     "/var/lib/collectd"
PIDFile     "/var/run/collectd.pid"
PluginDir   "/usr/lib/collectd"
TypesDB     "/usr/share/collectd/types.db"

LoadPlugin network

<Plugin network>
  <Listen "0.0.0.0" "25826">
    SecurityLevel None
  </Listen>
</Plugin>

LoadPlugin rrdtool
<Plugin rrdtool>
    DataDir "/var/lib/collectd/rrd"
</Plugin>

In this configuration, Collectd is listening on all interfaces (0.0.0.0) on port 25826, which is the default port for Collectd.

3. Install a Web Server:

Next, you’ll need to install a web server to host the graphs. Nginx or Apache can be installed with:

sudo apt-get install nginx

or

sudo apt-get install apache2

4. Install a Collectd Visualization Tool:

There are several different tools you can use to visualize the data collected by Collectd. Some of the more popular options include:

  • Collectd-web: A simple, standalone tool for visualizing Collectd data. Can be run with a simple Python server.
  • Grafana: A powerful visualization tool that supports a wide range of data sources including Collectd:

https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-grafana-on-ubuntu-22-04

The installation process will vary depending on the tool you choose. After the installation, configure the tool to read data from the directory where Collectd is storing its data (/var/lib/collectd/rrd in the provided example configuration).

5. Configure Firewall:

Finally, you’ll want to ensure that your firewall is configured to allow incoming connections to your Collectd server and your web server. The exact process will depend on your firewall setup, but here’s how you can do it with UFW:

sudo ufw allow 25826/udp
sudo ufw allow 80/tcp

This will allow incoming connections to the Collectd server (on port 25826) and the web server (on port 80).

The Collectd configuration on your OpenWRT nodes may also need to be updated to send data to the new server.

Best,

Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.