This repository contains an Checkmk special agent and agent plugin to access the Watterott CO₂-Ampel.
Unlike earlier attempts this extension uses a special agent approach accessing the JSON endpoint for added flexibility.
I will build MKPs from time to time when a rather stable state is reached and all components play well with each other. Install it as described in the Official Checkmk User Guide.
The agent data currently can be transferred in three different ways:
-
Via a typical special agent that accesses the sensor board via HTTP
-
Via a special agent configuration that reads a file from the filesystem – made for people who do things like
wget -O - http://198.51.100.23/json | ssh me@cmkserver 'cat > /tmp/co2.txt' -
Via an agent plug-in: the special agent can be deployed as agent plug-in to query a sensor board in the same network
Imagine this situation: You are running a few regular hosts in a NAT’ed network but also have a Watterott CO₂-Ampel in this network. Since you are using Checkmk Ultimate in free tier, you can use the push agent. But your CO₂-Ampels JSON endpoint is unavailable to the Checkmk server.
To solve this, you can deploy the special agent agent_watterott_co2_special as /usr/lib/check_mk_agent/plugins/watterott.py on any monitored host.
If the environment variable MK_CONFDIR is present, it will search for it’s config file and does not need CLI options.
Create that config file:
{ "host": "198.51.100.42", "piggyback": "some-host-name" }If you omit the piggyback key-value pair, the agent section will not be wrapped in a piggyback section and thus services will appear for the host that transfers the agent data instead of some-host-name.