Skip to content

Latest commit

 

History

History
79 lines (53 loc) · 2.69 KB

README.md

File metadata and controls

79 lines (53 loc) · 2.69 KB

checkmk NUT Plugin

Network UPS Tools (NUT) Plugin for checkmk 2.0.

Thanks to @minodudd and @gurubert for their previous work in this Plugin.

Installation

This plugin has to be installed separately in each of the parts that form a checkmk system.

First, clone or download the repository. Then...

Agent

We need to install the dependencies:

$ sudo apt install nut-client

Then, copy the file /usr/lib/check_mk_agent/plugins/nut to the same path where the agent is installed, and give 0775 permissions:

$ sudo chmod 775 /usr/lib/check_mk_agent/plugins/nut

You could restart the agent with the following commands. If the installation was successful, you should see the NUT info at the end of the output.

$ systemctl restart check_mk.socket
$ check_mk_agent
...
<<<nut>>>
serverroom_ups battery.charge: 100
serverroom_ups battery.voltage: 13.60
serverroom_ups battery.voltage.high: 13.00
serverroom_ups battery.voltage.low: 10.40
serverroom_ups battery.voltage.nominal: 12.0
serverroom_ups device.type: ups
...

Client (Raw)

Copy the file /local/lib/check_mk/base/plugins/agent_based/nut.py to the same path in the Raw Client of checkmk and give 0775 permissions:

$ sudo chmod 775 /local/lib/check_mk/base/plugins/agent_based/nut.py

If you are using the Docker checkmk image, surely you need to copy the file to the path /cmk/local/lib/python3/cmk/base/plugins/agent_based/nut.py inside the container.

Restart the client/container, and then go to the host where NUT and the Agent Plugin are installed and discover new services with a Full Service Scan.

Development

For development, you could modify any of the files that where installed and then restart the agent or the client to test the changes.

Indeed, you could execute this command to discover new services (filtered by nut) in the client:

OMD[cmk]:~$ cmk --detect-plugins=nut -vI <HOST>

Or, execute this command to obtain the nut plugin checks in the client:

OMD[cmk]:~$ cmk --plugins=nut -v --check nserver

If you are using the Docker checkmk image, you need to execute the command omd su cmk before this commands inside the container.

References