Plugins Location

Hi Team, im trying to setup a speedtest check for our internet connection. I have found this plugin that im trying to setup. GitHub - deexno/CheckMK_DSL_check: This CheckMK plugin allows you to visualise speed test data in CheckMK.

I have copied the speedtest script to the correct folder location im just stuck copying the plugin to the correct folder. I have tried coping the file multiple differerent ways but when i login to our site user account and navigate to cd local/lib/check_mk/base/plugins/agent_based there is no files there. What is the best way of copying plugins to the folder?

Hi @rubber_ducky

There shouldn’t be files there unless you already modified your Checkmk with some MKPs for example. Every modification on your Checkmk should be done under the local/ paths.
Just copy the file there like described in the README and the speedtest_agent_plugin.sh into your agent plugins folder. The Client Plugin goes onto your Host that you want to test/monitor, and the Server Plugin needs to be placed into the Checkmk server.

Please make sure that your permissions and ownership are properly set.

Hope this helps.
Norm

Okay cool. Im wanting to test the internet speed on the check_mk server. So i have installed the speed_test script and plugin agent in both on the checmk server in the local paths. However when i can the host in checkmk portal the service is not found. Can i check if the server has found the plugin? Whats the best way of troubleshooting this. I have attached a screenshot of the permissions when i have logged into the server via filezilla as the site users

Hi @rubber_ducky

this is not the right path. Please remove it from there.

Please do the following steps:

  • SSH into your Checkmk server

  • sudo su - sitename

  • cd local/lib/check_mk/base/plugins/agent_based

  • upload speedtest_server_plugin.py to the current directory

  • chmod +x speedtest_server_plugin.py

  • make sure the file owner is like the sitename

  • SSH into your Host you want to monitor

  • Make sure the Checkmk Agent is installed, otherwise do so

  • Install the dependencies and the speedtest cli

  • for Ubuntu/Debian: sudo apt-get install curl jq apcalc -y

  • curl -s https://packagecloud.io/install/repositories/ookla/speedtest-cli/script.deb.sh | sudo bash

  • sudo apt-get install speedtest

  • cd /usr/lib/check_mk_agent/plugins/

  • upload speedtest_agent_plugin.sh to the current directory

  • sudo chmod +x speedtest_agent_plugin.sh

  • Go into Checkmk and do a service discovery on the host you just added the plugin.

  • The services should show up if everything is done right and the plugin is still compatible with the current Checkmk version

Otherwise, it would make sense to create an MKP package of the plugin to install things a bit easier. You could create a Pull request on GitHub with it.

Hope that helped.
Norm

1 Like

Thanks so much for your help. This is the part i get stuck with. How to i copy the plugin to that directory. Everything i try i get permissioned denied? Do i have to add my sitename account to sudo permissions?

I managed to copy the file to the directory using the command su -c "cp /home/netmon/speedtest_server_plugin.py /local/lib/check_mk/base/plugins/agent_based" root

So now im up to the next step of changing the permissions of the file. I have tried chmod +x speedtest_agent_plugin.sh and chmod 755 speedtest_server_plugin.py as well as adding sudo to both commands. I keep on getting the error “Operation not permitted”

Hi @rubber_ducky,

glad that it helped you so far.

I just assume that your netmon user is a sudo user.
Leave the site user context again and either use a sudo user or become root on the machine.
Execute the following commands with elevated user permissions:

sudo chmod +x /omd/sites/hwps_monitoring/local/lib/check_mk/base/plugins/agent_based/speedtest_server_plugin.py

sudo chown hwps_monitoring. /omd/sites/hwps_monitoring/local/lib/check_mk/base/plugins/agent_based/speedtest_server_plugin.py

That should do the job. :slight_smile:

Looking forward to your answer!
Norm

1 Like

Sweet thanks man. This has fixed this this specific permission issue.

However when i rescan the server in check_MK server it doesnt find any extra services to monitor.
I have manually run a speedtest scan in the plugins directory on the host that i want to monitor. I and get permission denied error. What permissions does this folder need? How do i change these permissions? Im guessing the plugin is failing becuase its not generating the JSON file as it doesnt have permission to write to that directory.

Thanks for your help man. I finally got this one working. For anyone else taking notes here is the steps i took.

  1. Add write permissions to the plugins folder
    a. cd /usr/lib/check_mk_agent
    b. sudo chmod o+w /usr/lib/check_mk_agent/plugins

  2. Install dos2unix and convert the script
    a. sudo apt-get install dos2unix
    b. navigate to the plugins directory - cd /usr/lib/check_mk_agent/plugins/
    c. sudo dos2unix .\speedtest_agent_plugin.sh