Skip to content

Instantly share code, notes, and snippets.

@discarn8
Last active June 7, 2022 15:46
Show Gist options
  • Save discarn8/ef748d5a3b8c8a505e1ecc8fb77e54c5 to your computer and use it in GitHub Desktop.
Save discarn8/ef748d5a3b8c8a505e1ecc8fb77e54c5 to your computer and use it in GitHub Desktop.
Nagios Check Raspberry Pi Voltage
/usr/lib/nagios/plugins/check_voltage
-----------------------------------------------------
#!/bin/sh
voltage=$(for i in core sdram_c sdram_i sdram_p ; do echo $i `/opt/vc/bin/vcgencmd measure_volts $i`; done)
echo $voltage | awk -F"V " '{print $1"V\n"$2"V\n"$3"V\n"$4}'
exit 0
------------------------------------------------------------
/etc/nagios/nrpe.cfg | egrep -v '#|^$'
------------------------------------------------------------
command[check_users]=/usr/lib/nagios/plugins/check_users -w 3 -c 4
command[check_load]=/usr/lib/nagios/plugins/check_load -r -w 1.95,1.90,1.80 -c 2.10,2.00,1.90
command[check_hda1]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /
command[check_zombie_procs]=/usr/lib/nagios/plugins/check_procs -w 5 -c 10 -s Z
command[check_total_procs]=/usr/lib/nagios/plugins/check_procs -w 250 -c 300
command[check_apt]=/usr/lib/nagios/plugins/check_apt
command[check_ntp]=/usr/lib/nagios/plugins/check_ntp_time -H 1.1.1.1 -w 2 -c 5
command[checknfs]=sudo -u root /usr/lib/nagios/plugins/check_nfs.sh
command[check_hw]=sudo -u root /usr/lib/nagios/plugins/check_hw
command[check_os]=sudo -u root /usr/lib/nagios/plugins/check_os
command[check_rasp_temp]=sudo -u root /usr/lib/nagios/plugins/check_rasp_temp -w 145 -c 165
command[check_throttled]=sudo -u root /usr/lib/nagios/plugins/check_throttled
command[check_v]=sudo -u root /usr/lib/nagios/plugins/check_voltage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment