Posts: 7
Joined: Mon Mar 14, 2016 11:26 pm

Zabbix Monitoring and programming of SenseHat Statistics

Fri Mar 18, 2016 9:10 pm

I now have the latest version of http://www.zabbix.com/ running on the Rasberry Pi 2 equipped with 1 sense hat. It is monitoring the internal environmentals for my 1986 Avion 34V Trailer. I am going to try to add a second sense hat for the externals.

My plans are to use this as a basis to monitor my Vineyard in San Andreas, CA

Anyone needing help in getting this package running, write me at vance.turner@sbcglobal.net

I had to add the python statistics library to calculate the median since the sense hat has sporadic data drops for some reason.

#!/usr/bin/env python

import time
import random
import statistics
from sense_hat import SenseHat
sense = SenseHat()
TC0 = sense.get_temperature()
TC1 = sense.get_temperature()
TC2 = sense.get_temperature()
TC3 = sense.get_temperature()
TC4 = sense.get_temperature()
TC5 = sense.get_temperature()
TC6 = sense.get_temperature()
TC7 = sense.get_temperature()
TC8 = sense.get_temperature()
TC9 = sense.get_temperature()

stats = [TC0, TC1, TC2, TC3, TC4, TC5, TC6, TC7, TC8, TC9]
temperature_celsius = statistics.median( stats )
temperature_fahrenheit = 9.0/5.0 * temperature_celsius + 32
print (temperature_fahrenheit)

Return to “The MagPi”