Zabbix in your homeenvironment
Brian van Baekel
Opensource ICT Solutions
Zabbix Conference BeNeLux 2019
February 1 2019
Zabbix Conference BeNeLux 2019

Opensource ICT Solutions

whoamiBrian van Baekel• Zabbix consultant• Zabbix trainer• Network engineer

Zabbix Conference BeNeLux 2019

Opensource ICT Solutions

Opensource ICT Solutions

Why
Just because it’s possible.

Zabbix Conference BeNeLux 2019

Opensource ICT Solutions

Hardware

HardwareZabbix Conference BeNeLux 2019

Opensource ICT Solutions

Hardware

Full blown server
Pro’s• Hardware• Temperature management• Reliability••••

Zabbix Conference BeNeLux 2019

ConsPower consumption
NoisePriceSize

Opensource ICT Solutions

Hardware

Raspberry piPro’s••••

PriceSize
GPIO pins
Flexible!

Cons• Hardware• Reliability

Zabbix Conference BeNeLux 2019

Opensource ICT Solutions

Hardware

Something in between
Pro’s••••

PriceSize
HardwarePower usage

Cons• Reliability

Zabbix Conference BeNeLux 2019

Opensource ICT Solutions

Hardware

But what?
••••

Intel NUC
Gigabyte Brix
UDOO bolt v8
ODROID-H2

Zabbix Conference BeNeLux 2019

Opensource ICT Solutions

Zabbix
Which version, and what setup?

Zabbix Conference BeNeLux 2019

Opensource ICT Solutions

ZabbixSetup••••

Latest and greatest
All on the same machine
no redundancy
A lot of “playground” configuration

Zabbix Conference BeNeLux 2019

Opensource ICT Solutions

What to monitor?
• Philips Hue?
• Google Nest?
• Sonoff?
• 3D Printer?
• Power consumption?
• Plants?

Zabbix Conference BeNeLux 2019

Opensource ICT Solutions

Monitoring - Hue

Philips hue
•
•
•
•

What?
Are the lights on or off
Which lights are on, and which color
Are there updates available
Model IDHow?
• Zabbix agent with a UserParameter• New HTTP agent item

Zabbix Conference BeNeLux 2019

Opensource ICT Solutions

Monitoring - Hue

Philips hue - UserParameter
How?

Result{UserParameter=hue.get[*],curl -s http://$1/api/$2
Zabbix Conference BeNeLux 2019"lights":{"1":{"state":{"on":false,"bri":254,"alert":"none","mode":"homeautomation","reachable":true},"swupdate":{"state":"noupdates","lastinstall":"2019-01-05T12:53:29"},….
Opensource ICT Solutions

Monitoring - Hue

Philips hue – HTTP AgentHow?

Result{"lights":{"1":{"state":{"on":false,"bri":254,"alert":"none","mode":"homeautomation","reachable":true},"swupdate":{"state":"noupdates","lastinstall":"2019-01-05T12:53:29"},….

Zabbix Conference BeNeLux 2019

Opensource ICT Solutions

Monitoring - Hue

Philips hue – Master/dependent item

Zabbix Conference BeNeLux 2019

Opensource ICT Solutions

Monitoring - Hue

Philips hue – Preprocessing
What?

{Value mapping

Zabbix Conference BeNeLux 2019

Result"lights":{"14":{"state":{"on":false,

True => 1
False => 0

Opensource ICT Solutions

Monitoring - Hue

Philips hue – Result

Zabbix Conference BeNeLux 2019

Opensource ICT Solutions

Monitoring - Hue

Philips hue – Controlling
ActionOperation

Zabbix Conference BeNeLux 2019

Opensource ICT Solutions

Monitoring - Hue

Philips hue – Presentation
All lights off

Zabbix Conference BeNeLux 2019

Lights in my home office on

Opensource ICT Solutions

Monitoring - Hue

Philips hue – Controlling
Frontend scripts to the rescue…

Zabbix Conference BeNeLux 2019

Opensource ICT Solutions

Controlling - Sonoff

Preventing damage
If temperature < 4 C
Trigger goes into problem state
Action must be taken.

Zabbix Conference BeNeLux 2019

Opensource ICT Solutions

Controlling - Sonoff

SonoffPro’sCons• Small• Cheap ( ± €4)• Custom firmware (tasmota)• Fragile• Unsafe?????

Zabbix Conference BeNeLux 2019

Opensource ICT Solutions

Controlling - Sonoff

Sonoff - Tasmota
curl -sL http://<IP>/cm?cmnd=Power%20on
curl -sL http://<IP>/cm?cmnd=Power%20off
curl -sL http://<IP>/cm?cmnd=Power%20toggle

Zabbix Conference BeNeLux 2019

Opensource ICT Solutions

Controlling - Sonoff

Sonoff in Zabbix

Zabbix Conference BeNeLux 2019

Opensource ICT Solutions

Monitoring - Temperature

Temperature
What?
• TemperatureHow?
• Raspberry PI• DHT22 / DS18B20• Python + Zabbix SenderZabbix Conference BeNeLux 2019

Opensource ICT Solutions

Monitoring - Temperature

Setup
Sensor is connected to GPIO ports
Python script reads the output
Calls Zabbix Sender once per minuteZabbix Conference BeNeLux 2019

Opensource ICT Solutions

Monitoring - Temperature

ResultZabbix Conference BeNeLux 2019

Opensource ICT Solutions

Notifications

Zabbix Conference BeNeLux 2019

Opensource ICT Solutions

Notifications - EmailEmailZabbix Conference BeNeLux 2019

Opensource ICT Solutions

Notifications - Pushover

SMSPro’s• Reliable• Fast• Independent of internet
accessCons• Expensive hardware• Based on cell service• Monthly fee / price per sms

Zabbix Conference BeNeLux 2019

Opensource ICT Solutions

Notifications - Pushover

Pushover“Simple notifications for Android, iOS and Desktop”
Pro’s
• API
• Cheap• Both desktop and phone

Zabbix Conference BeNeLux 2019

Opensource ICT Solutions

Notifications - Pushover

Pushover

Zabbix Conference BeNeLux 2019

Opensource ICT Solutions

Thank you
Questions?

Zabbix Conference BeNeLux 2019

Opensource ICT Solutions