DHT22 Sensor nagios plugin for Single Board Computers
Copyright (c) 2017 Frostbyte [email protected]
Check environment temperature and humidity with DHT22 via GPIO
- [email protected] - wiringPi library and rht03 code
- [email protected] - plugin development guidelines
- Output includes perfdata
- Threshold ranges (min/max) for both temperature and humidity
- Both warning and critical thresholds may be fully or partially omitted
- Anything that has not been explicitly specified will be disabled
- Only allows for threshold ranges that are within the sensor's documented capabilities
- Temperature: from -40 to 80
- Humidity: from 0 to 100
- Output validation against the sensor's checksums and documented capabilities
- If measured data are invalid, will retry every 2 seconds for a maximum of 4 times
- Raspberry Pi
- Raspberry Pi 2
- Raspberry Pi 3
- ASUS Tinker Board
- Give execution permissions to the build script and execute it:
- chmod u+x build && ./build
- Copy the compiled plugin to the nagios plugins directory:
- sudo cp bin/check_dht22 /usr/local/lib/nagios/plugins/check_dht22
- Allow nagios/icinga to execute the plugin as sudo, by adding this entry to the sudoers file:
- nagios ALL=(ALL) NOPASSWD: /usr/local/lib/nagios/plugins/check_dht22
- sudo check_dht22 -p <gpio_pin> [-w tmp_warn_range,hum_warn_range] [-c tmp_crit_range,hum_crit_range]
- example: sudo check_dht22 -p 7 -w 10:40,30:70 -c 5:45,25:75