1
0
mirror of https://github.com/larsen0815/check_rasp_temp.git synced 2024-11-21 18:03:48 +01:00

Rename "check_rasp_temp" to "check_rasp_temp.sh"

This commit is contained in:
larsen0815 2023-03-13 12:48:25 +01:00
parent 1fff8f14c4
commit 03cba89c26
2 changed files with 54 additions and 54 deletions

108
README.md
View File

@ -1,54 +1,54 @@
# check\_rasp\_temp # check\_rasp\_temp
Nagios-Plugin to check the CPU temperature of a Raspberry Pi Nagios-Plugin to check the CPU temperature of a Raspberry Pi
## Installation ## Installation
This example uses a Raspberry Pi with Raspbian Wheezy and a Nagios server running Debian Wheezy. This example uses a Raspberry Pi with Raspbian Wheezy and a Nagios server running Debian Wheezy.
You might want to use other thresholds, e.g. the Raspberry in our server room is normally running at ~43°C so I have set the threshold to 45°C. You might want to use other thresholds, e.g. the Raspberry in our server room is normally running at ~43°C so I have set the threshold to 45°C.
#### Download Plugin #### Download Plugin
``` ```
cd /usr/lib/nagios/plugins/ && \ cd /usr/lib/nagios/plugins/ && \
wget https://raw.githubusercontent.com/larsen0815/check_rasp_temp/master/check_rasp_temp && \ wget https://raw.githubusercontent.com/larsen0815/check_rasp_temp/master/check_rasp_temp.sh && \
chmod +x check_rasp_temp chmod +x check_rasp_temp.sh
``` ```
#### Plugin needs to be run as root #### Plugin needs to be run as root
``` ```
cat <<EOF > /etc/sudoers.d/nagios_rasp_temp cat <<EOF > /etc/sudoers.d/nagios_rasp_temp
nagios ALL=(root) NOPASSWD: /usr/lib/nagios/plugins/check_rasp_temp nagios ALL=(root) NOPASSWD: /usr/lib/nagios/plugins/check_rasp_temp.sh
EOF EOF
``` ```
#### Define NRPE command with thresholds #### Define NRPE command with thresholds
``` ```
cat <<EOF > /etc/nagios/nrpe.d/rasp_temp.cfg cat <<EOF > /etc/nagios/nrpe.d/rasp_temp.cfg
command[check_rasp_temp]=sudo -u root /usr/lib/nagios/plugins/check_rasp_temp -w 60 -c 70 command[check_rasp_temp]=sudo -u root /usr/lib/nagios/plugins/check_rasp_temp.sh -w 60 -c 70
EOF EOF
``` ```
#### Reload NRPE server #### Reload NRPE server
``` ```
service nagios-nrpe-server reload service nagios-nrpe-server reload
``` ```
#### Define service on your Nagios host #### Define service on your Nagios host
``` ```
define service{ define service{
use generic-service use generic-service
hostgroup_name raspberry-devices hostgroup_name raspberry-devices
service_description Temperature service_description Temperature
check_command check_nrpe!check_rasp_temp check_command check_nrpe!check_rasp_temp
} }
``` ```
#### Reload Nagios server #### Reload Nagios server
``` ```
service nagios3 reload service nagios3 reload
``` ```
#### Test your new check on your Nagios server #### Test your new check on your Nagios server
``` ```
/usr/lib/nagios/plugins/check_nrpe -H #Raspberry_IP# -c check_rasp_temp /usr/lib/nagios/plugins/check_nrpe -H #Raspberry_IP# -c check_rasp_temp
``` ```