As I was working on a VOC sensor setup with Raspberry Pi, I also wanted to monitor the Pi's board temperature. Turns out on Raspbian there is already a command prepared for this:
pi@raspberrypi:~ $ /usr/bin/vcgencmd measure_temp
This Raspberry Pi is already integrated into an Icinga 2 monitoring. Wouldn't it be nice to use the already running NRPE server and have a plugin for this?
Here you go: check_rpi_temp does exactly that. It reads the current temperature from the board, compares it against (optional) thresholds and can output data in either Celsius (default) or in Fahrenheit. Thanks to the performance data you can create historical graphs for the Raspberry Pi board temperature:
The usage is straight forward:
pi@raspberrypi:~ $ /usr/lib/nagios/plugins/check_rpi_temp.py -w 50 -c 60
RPI TEMP OK: Temperature 40.80 degrees c |rpi_temp=40.80;50.00;60.00;;
Or if you prefer Fahrenheit:
pi@raspberrypi:~ $ /usr/lib/nagios/plugins/check_rpi_temp.py -w 90 -c 105 -u f
RPI TEMP CRITICAL: Temperature 105.44 is higher than critical threshold (105.00) |rpi_temp=105.44;90.00;105.00;;
Important note: You need to make sure the user running the command is able to execute vcgencmd. For example if you use the 'nagios' user (default in an NRPE setup), the command fails:
nagios@raspberrypi:~$ /usr/bin/vcgencmd measure_temp
VCHI initialization failed
By default the "pi" and the "root" user are able to run this command. So either define a sudoers rule or create a new user with the same privileges as the pi user.
No comments yet.
AWS Android Ansible Apple Atlassian Automation BSD Backup Bash Bluecoat CMS Chef Cloud Consul Container Containers CouchDB DB DNS Database Databases Docker ELK ElasticSearch Elasticsearch Filebeat FreeBSD GlusterFS Grafana Graphics HAProxy HTML Hacks Hardware Icinga Icingaweb2 InfluxDB Internet Java Kibana Kubernetes LXC Linux Logstash Mac Macintosh Mail MariaDB Minio MongoDB Monitoring Multimedia MySQL NFS Nagios Network Nginx OSSEC OTRS PGSQL PHP Perl Personal PostgreSQL Postgres PowerDNS Proxmox Proxy Rancher SSL Security Shell SmartOS Solaris Surveillance SystemD TLS Tomcat Ubuntu Unix VMware Varnish Virtualization Windows Wireless Wordpress Wyse ZFS Zoneminder