Wednesday, July 13, 2016

How to quickly install check_mk agent plugins

Check_mk has many agent plugins that a lot of us are not aware of. Some of them would open up monitoring opportunities that were not even considered about. Best of all, some of these plugins use APIs readily available to talk to applications and services. Theses same APIs are used by other commercial programs so the information gleamed from them is commercial-grade.
The hardest part of installing the application is to copy the plugin. The best option is to use the plugin provided by the monitoring Check_mk system. This ensures that the plugin works with the check_mk agent installed on the host. But it may not be convenient to download the plugin to the PC and upload it back to another server. So this is a really quick way to do this.
  1. First, ssh to the host and go the plugin directory, usually /usr/lib/check_mk_agent/plugins
  2. Open the browser to the WATO-Configuration ==> Monitoring Agents window of your Check_mk / OMD installation. 
  3. Right-click on the plugin you wish to upload to the host and copy the URL
  4. Go to the ssh window and type wget.
  5. Then paste the URL, which should look something like This is for the apache_status plugin.
  6. Since Check_mk / OMD requires a login, edit the line to look like this  http://<Username>:<password>@ and press Enter.
  7. Change the permission of the plugin to be executable using chmod ugo+x apache_status 
That should do the trick. Go to Wato-Configuration ==> Hosts. Select the Host that the plugin was added to. Click on the Services button and activate the (new) missing services. Apply the configuration and the plugin should now be active. Check the services of that Host to see the new services.
Some plugins have specific requirements, like the credentials to access the service it monitors. The apache_status plugin needs a specific configuration to be in the apache configuration file. For example, the mk_mysql agent requires the credentials to be in the /etc/check_mk/mysql.cfg file. The file should look like this (replace with the correct information)

Meet these requirements and  the agent can run and report on the service. Finally, you can go into WATO and check for the Host's Services menu item. The newly discovered services can be enabled here.

Wednesday, July 6, 2016

Check_mk Inventory not updating Solved

If you are just installing the check_mk inventory plugin, please understand the the plugin only run between a set interval times. This is because the inventory process is places a high load on the server and repeating it would impact the performance of the server. The default interval is 4 hours.
You can force an inventory check by doing the following
  1. Find and delete the mk_inventory.last.* file. This is the file that stores the last time the inventory process was run
  2. Go to the check_mk web interface and trigger / refresh the Check_MK HW/SW Inventory service.

Observe the Output of the check plugin entry in the service detail table for Check_MK HW/SW Inventory service. It should read a lot of entries.