Tuesday, June 28, 2016

Setting up the Check_mk Inventory plugin

Check_mk and by extension, OMD have a feature to audit the hardware and software inventory of a server that is being monitored. This can be used to find servers below of a specific specification (e.g RAM too low) or details of an installed software package. To do this, the Check_mk inventory plugin has to be installed. This is a two phase process. First we need to install the check_mk inventory plugin and then we need to setup Check_mk/OMD to start polling the server for inventory information.

Installing the check_mk inventory plugin

The plugin itself is very similar to how other plugins are installed.
  1. Obtain the plugin. This can be found in OMD at Wato Configuration ==> Monitoring agent. Download the file.
  2. Copy the file to the check_mk plugin directory. This can be at either in /usr/lib/check_mk_agent/plugins/ for RedHat/CentOS or in a directory called plugins located in the same directory as the check_mk_agent.exe file.
  3. For Linux hosts, change the file permissions to allow the plugin to be executable.
  4. For Windows hosts, the system account running the check_mk agent has the appropriate permissions to check the service the plugin is for.

Configuring Check_mk to poll for inventory information

Once the plugin is installed, check_mk must be told which servers to poll for the inventory information. Polling for this is done less often than polling for status. It is done via a ruleset.
  1. In Wato Configuration, go to Hosts.
  2. Click on the Rulesets button on the top.
  3. Click on Hardware/Software Inventory button. (bottom left button)
  4. Click on Do hardware/software Inventory
  5. If there are no rules in the folder, click Create rule in folder. Otherwise click on the green pencil icon to edit the existing rule.
  6. Check the box marked Specify explicit host names and enter the hostname of the host to be inventoried. 
  7. If this is an existing rule, understand the current settings and modify accordingly. If you are not sure, go back, create a new rule and repeat rule 6. 

 It will take some time for the hardware and software to be inventoried. Go to View ==> All Hosts. The hosts that are being inventoried have an icon showing a blue window with a CD in front of it.
Click on this icon to show the inventory. The inventory is displayed as a tree, so you need to expand it to show more items. If you are seeing only the hardware inventory showing only RAM information, the plugin is not working or hasn't been run yet. Click the refresh icon in the All Hosts screen to trigger this.
There are more inventory related operation in the Main Menu. Once the inventory is populated, these functions will be useful to discover or find hardware or software installed in the hosts that are being monitored.
If a few hours has passed and the inventory is still not updating, try this to immediately force an inventory check.

No comments:

Post a Comment