Configure Collectd as a Central Monitoring Server for Clients

Step 3: Configure Collectd Clients

6. The activation of client instances for Collectd daemon resembles with the server configuration, meaning the same Network plugin must be loaded, the only difference here being the fact that you should instruct the Network client where to send the data.

So, repeat the same steps as for the server setup, and, when you reach the Network plugin block, uncomment the below statements and replace the Server IP Address according to your Collectd server IP.

# nano /etc/collectd/collectd.conf
OR
# nano /etc/collectd.conf

Client file excerpt:

<Plugin network>
# client setup:
      <Server "192.168.1.211" "25826">
       </Server>
...
</Plugin>

Configure Collectd Clients

7. Finally, restart the collectd daemon to apply changes and visit your Collectd server IP Address in order to visualize the collected data so far as illustrated on the below screenshot.

# service collectd restart
or
# systemctl restart collectd   [For systemd init services]
Collectd Client Monitoring
Collectd Client Monitoring

Repeat the client configuration steps on all your collectd systems that you want to monitor and they should appear on your central Collectd server.

Step 4: Encrypt Collectd Client-Server Traffic

8. So far, all of the client transmitted data is done in clear text make it easy for unauthorized users to intercept and read data.

In order to cryptographically sign and encrypt the traffic using a mechanism similar to Apache .htacces authentication, you need to create an htpasswd file on the server and instruct all the clients to sign and encrypt data with the htpasswd credentials.

On the first step go to the Collectd server machine and create a passwd file by issuing the below command (install apache-utils or httpd-tools package if htpasswd command is not present on your server).

# htpasswd -c /etc/collectd/passwd your_username
Apache Password Protection
Create Apache Password Protection

9. After the credentials are created, use the cat command to view passwd file content and copy the password string to a safe location – you will need it later for client setup.

# cat /etc/collectd/passwd
View Password
View Password

10. Next, on the server side, open the main collectd configuration file for editing, navigate to Network plugin block, uncomment following statements (replace AuthFile statement according to your local passwd file path):

# nano /etc/collectd/collectd.conf
OR
# nano /etc/collectd.conf

Server File excerpt:

<Plugin network>
...
# server setup:
      <Listen "0.0.0.0" "25826">
	   SecurityLevel Sign
                  AuthFile "/etc/collectd/passwd"
       </Listen>
...
</Plugin>

11. Once you’re done, restart Collectd server to apply the changes and move to client side.

# service collectd restart
or
# systemctl restart collectd   [For systemd init services]

12. On the client side, repeat the same steps and uncomment the client statements from the Network plugin block, replacing the Username and Password statements according to your server passwd file.

# nano /etc/collectd/collectd.conf
OR
# nano /etc/collectd.conf

Client file excerpt:

<Plugin network>
# client setup:
      <Server "192.168.1.211" "25826">
SecurityLevel Encrypt
              	Username "your_server_passwd_username"
             	Password "your_server_passwd_hash_password"
       </Server>
...
</Plugin>
Configure Collectd Authentication
Configure Collectd Authentication

That’s it! restart Collectd daemon and repeat this step on all your Collectd client instances in order to communicate with the central node over a secure channel.

If this article helped, with someone on your team.

TecMint Weekly Newsletter
Get the Learn Linux 7 Days Crash Course free when you join 34,000+ Linux professionals reading every Thursday.
Check your email for a magic link to get started.
Something went wrong. Please try again.
TecMint has been free for 14 years. Help keep it that way.
Google AI Overviews and tools like ChatGPT have cut into search traffic for independent tech sites like TecMint. Running this site costs over $2,000 every month for hosting, infrastructure, and paying authors to keep the content accurate and tested.

If this article helped you solve a problem, consider buying a coffee. It helps keep TecMint free, supports the authors, and keeps the project going.
☕ Buy Me a Coffee
Matei Cezar
I'am a computer addicted guy, a fan of open source and linux based system software, have about 4 years experience with Linux distributions desktop, servers and bash scripting.

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

3 Comments

Leave a Reply
  1. Hi,

    Just had a small query since i am setting up a client server architecture for collectd, is it possible that for all the clients my thresholds are set on the server side?

    Reply

Got Something to Say? Join the Discussion...

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.

Free Course
Get a free Linux course before you go.
Subscribe to TecMint Weekly and get the Learn Linux 7 Days Crash Course free. Read by 34,000+ Linux professionals every Thursday.
Something went wrong. Please try again.
Check your email for a magic link to get started.