added check_temperature plugin to monitor temperatures on a RaspberryPi

This commit is contained in:
2016-10-17 18:44:33 +02:00
parent 4a52b30270
commit a1eeb872bf
2 changed files with 331 additions and 0 deletions

View File

@@ -24,6 +24,8 @@ This repository contains the following scripts:
monitor multi-home and dual-stack (i.e. ipv4 and ipv6) servers.
* [check_otp](#check_otp)
plugin to monitor PrivacyIDEA (and LinOTP) OTP validation
* [check_temperature](#check_temperature)
plugin to monitor the temperature of a 1-wire sensor on a RaspberryPi
* [nagiosstatus](#nagiosstatus)
CGI-BIN script to report the status of nagios (to monitor nagios itself)
@@ -233,6 +235,63 @@ define service {
~~~
<a name=check_temperature>plugins/check_temperature</a>
-------------------------------------------------------
Plugin (check) to monitor monitor the temperature using a sensor connected to a
RaspberryPi. This implementation is specifically for the DS18B20 1-wire
temperature sensor. Other methods and interfaces can be plugged in easily (just
raise a request or provide a patch). For information on how to connect sensor
to the RaspberryPi and to get it working please see [this Adafruit tutorial](
https://learn.adafruit.com/adafruits-raspberry-pi-lesson-11-ds18b20-temperature-sensing).
To enable the 1-wire interface support on the RaspberryPi one can use the
command:
~~~
sudo raspi-config nonint do_onewire 0
~~~
or use `raspi-config` in interactive mode (9. Advanced Options --> A9. 1-Wire).
Please note that changing this requires a reboot.
Installation for is straightforward, after installing the script on the server
add the following to your Nagios `commands.cmd` configuration file:
~~~
# 'check_temperature' command definition to monitor a single temperature in C
# parameters: warning (ARG1) and critical (ARG2) temperature in Celcius
define command {
command_name check_temperature
command_line [install_path]/plugins/check_temperature -w $ARG1$ -c $ARG2$
}
# 'check_ftemperature' command definition to monitor a single temperature in F
# parameters: warning (ARG1) and critical (ARG2) temperature in Farenheit
define command {
command_name check_ftemperature
command_line [install_path]/plugins/check_temperature -F -w $ARG1$ -c $ARG2$
}
# 'check_temperature_sensor' command definition to monitor a single temperature in C
# parameters: sensor serial (ARG1), warning (ARG2) and critical (ARG3) temperature in Celcius
define command {
command_name check_temperature_sensor
command_line [install_path]/plugins/check_temperature -s $ARG1$ -w $ARG2$ -c $ARG3$
}
# 'check_ftemperature_sensor' command definition to monitor a single temperature in F
# parameters: sensor serial (ARG1), warning (ARG2) and critical (ARG3) temperature in Farenheit
define command {
command_name check_ftemperature_sensor
command_line [install_path]/plugins/check_temperature -F -s $ARG1$ -w $ARG2$ -c $ARG3$
}
~~~
Make sure to replace `[install_path]/plugins` with the location of the script.
Please run `check_temperature -h` after installation for an overview of the
available command line options (e.g. to enable logging to a file).
<a name=nagiosstatus>cgi-bin/nagiosstatus.sh</a>
------------------------------------------------
Very simplistic CGI-BIN script that checkes whether nagios is still running and