Tuesday, August 15, 2017

Install check_mk agent on Centos 7

This is an update to the other check_mk client instructions which is more general.There are 3 major steps: a. installing the required package repository, b.installing the client package and c. configuring systemd and the firewall to start and allow the check-mk server to access it.

1. For this you need to install the epel repository by installing the epel package available from EPEL. Then, you can search the repository to verify that it does have the check-mk client.
yum search check-mk-agent
2. The above command should show the current version of the agent available to be installed. To install it: yum install check-mk-agent
3. Change to the systemd service directory: cd /etc/systemd/system
4. Copy the check-mk agent socket file: cp /usr/lib/systemd/system/check_mk.socket .
5. Create a link for the check-mk agent service file: ln -s /usr/lib/systemd/system/check_mk@.service .
6. Enable the check-mk agent service: systemctl enable check_mk.socket . Then start it: systemctl start check_mk.socket.This can be verified with the command systemctl status check_mk.socket. Look for the line beginning with "Active" which should say "active (listening)".
7. Open the port in the firewall: firewall-cmd --zone=public --add-port=6556/tcp --permanent . The --permanent option will save the rule and make it permanent, even if the server is rebooted.
 After this, add the server at the OMD or check_mk server and you're done.
For Extra Credit: Be aware of where the locations for the plugins are by running rpm -ql check-mk-agent to see all the files installed and where the plugins are. Copy and configure those that you need to /usr/share/check-mk-agent/plugins to be activated and used by the agent.