Check_MK Agent Setup
Check_MK Agent Setup

If you wish to collect data from remote systems, then use LibreNMS in combination with check_mk. The agent can be extended to include information about applications on the remote system. let’s see how check_mk agent is setup.

Installation in Linux/ BSD

If you’re using the Distributed Polling setup, then allow access from the LibreNMS host and poller nodes on TCP-Port 6556. Check systemd or xinetd is installed on the host where the agent will run.

The following process is to be done on each host that you want to use the agent on:

1.Clone the repository for the librenms-agentcd /opt/git clone https://github.com/librenms/librenms-agent.gitcd librenms-agent

2.  Now copy the proper check _mk_agent to /usr/bin.linux                                          

cp check_mk_agent /usr/bin/check_mk_agent 
freebsdcp check_mk_agent_freebsd /usr/bin/check_mk_agent
chmod +x /usr/bin/check_mk_agent

3. Place the service files thereby copying them.xinetd      

cp check_mk_xinetd /etc/xinetd.d/check_mk     

systemdcp check_mk@.service check_mk.socket /etc/systemd/system

4. Then make a required directories.mkdir -p /usr/lib/check_mk_agent/plugins /usr/lib/check_mk_agent/local

5. Copy each script from agent-local/ that you want to graph into /usr/lib/check_mk_agent/local

6. By using the command chmod +x /usr/lib/check mk agent/local/$script make each one executable.

7. Allow the check_mk service to run in systemdxinetd     

/etc/init.d/xinetd restart    
systemdsystemctl enable check_mk.socket && systemctl start check_mk.socket

8. Log in to the LibreNMS web interface and select the device to monitor. Make sure unix-agent is enabled in the modules section. Also, select the apps from the applications that you want to monitor.

9. Now it will take around 10 minutes for data to appear in your graphs under Apps for the device.

Restrict the devices the agent uses to listen: Linux system

Follow these steps to restrict the network adapter on which the agent listens:
1.  Modify /etc/systemd/system/check_mk.socket

2.  Add a new line with BindToDevice= and the name of your network adapter to the [Socket] section.

 

3.  In case the script has an enabled system then you must run systemctl daemon-reload followed by systemctl restart check_mk.socket.

If you need any assistance with check_mk agent setup you can get assistance here.

Frequently Asked Questions

Everything you need to know about Check_MK agent setup and LibreNMS integration.

1 What is the Check_MK agent and why is it used with LibreNMS?
The Check_MK agent is a lightweight monitoring agent installed on remote hosts to collect system data such as CPU usage, memory, disk, and running services. When combined with LibreNMS, it extends the default SNMP-based monitoring by providing deeper application-level metrics that SNMP alone cannot capture.
2 What port does the Check_MK agent use, and do I need to open it in the firewall?
The Check_MK agent listens on TCP port 6556. Yes, you must allow inbound access on this port from your LibreNMS host and any poller nodes. If you are using UFW or iptables, add a rule to allow traffic on port 6556 from trusted IPs only to keep the agent secure.
3 What is the difference between using xinetd and systemd for the Check_MK agent?
Both xinetd and systemd are service managers that control how the Check_MK agent runs on your server. xinetd is the older method, suitable for legacy Linux systems. systemd is the modern approach recommended for Ubuntu 16.04+, CentOS 7+, and AlmaLinux. If your server supports systemd, use the check_mk.socket method for better reliability and resource efficiency.
4 How do I verify that the Check_MK agent is running correctly?
After installation, test the agent from your LibreNMS server using:

telnet <host-ip> 6556
or
nc -zv <host-ip> 6556

If the agent is working, you will see raw monitoring data returned in plain text. If the connection is refused, check that the service is active and that port 6556 is open in the firewall.
5 How long does it take for data to appear in LibreNMS after installing the Check_MK agent?
After enabling the unix-agent module and selecting the applications to monitor in the LibreNMS web interface, it typically takes around 10 minutes for data to begin appearing in the graphs under the Apps section for that device. This depends on your LibreNMS polling interval settings.
6 Can I restrict which servers are allowed to connect to the Check_MK agent?
Yes. On Linux systems using systemd, edit /etc/systemd/system/check_mk.socket and add a BindToDevice= line under the [Socket] section with your preferred network interface name. After saving, run:

systemctl daemon-reload
systemctl restart check_mk.socket
7 What should I do if the Check_MK agent is installed but LibreNMS shows no data?
Check the following in order:
  • Confirm the unix-agent module is enabled for the device in LibreNMS
  • Verify port 6556 is reachable from the LibreNMS host
  • Ensure /usr/bin/check_mk_agent has executable permissions (chmod +x)
  • Confirm the systemd socket or xinetd service is actively running
  • Check that the correct apps are selected under the Applications tab for the device
8 Is the Check_MK agent supported on FreeBSD as well as Linux?
Yes. The LibreNMS agent repository includes a dedicated agent script for FreeBSD. During installation, copy check_mk_agent_freebsd instead of check_mk_agent to /usr/bin/check_mk_agent and follow the same remaining steps. Directory setup, plugin configuration, and LibreNMS web interface configuration are identical across both platforms.
Need help with server monitoring setup? ACTSupport’s 24/7 NOC team manages Check_MK, LibreNMS, and 20+ monitoring tools for hosting providers and enterprises worldwide.
Talk to Our Team →

Also check: How to Install Checkmk Agent on Windows Server

To get more updates you can follow us on Facebook, Twitter, LinkedIn

Subscribe to get free blog content to your Inbox
Loading

Related Posts