Zabbix - Beyond the Norm!
Transcript of Zabbix - Beyond the Norm!
![Page 1: Zabbix - Beyond the Norm!](https://reader034.fdocuments.in/reader034/viewer/2022051506/58739c321a28ab87318c3b6f/html5/thumbnails/1.jpg)
– Beyond the Norm? ZABBIX
![Page 2: Zabbix - Beyond the Norm!](https://reader034.fdocuments.in/reader034/viewer/2022051506/58739c321a28ab87318c3b6f/html5/thumbnails/2.jpg)
Bio
• Name: Aidan Venn
• Zabbix irc & Forum: avenn
• Experience: 17 years in IT - networking
• Company: ObservIT Ltd & MV Digital Ltd
![Page 3: Zabbix - Beyond the Norm!](https://reader034.fdocuments.in/reader034/viewer/2022051506/58739c321a28ab87318c3b6f/html5/thumbnails/3.jpg)
Unique? site facts
• 7 R & D sites x Various sensors & actuators
• Unique In house designed Chinese Components
• Concept works
• Soon to come out of Beta stage v23.4
![Page 4: Zabbix - Beyond the Norm!](https://reader034.fdocuments.in/reader034/viewer/2022051506/58739c321a28ab87318c3b6f/html5/thumbnails/4.jpg)
Background – Energy Costs
“The cost total has more than doubled over the last 10 years. Energy price rises have been proportionately higher for industry and have direct impacts on costs and competitiveness…”
“There is little prospect of a sustained reversal in these trends. It is more likely that price increases will continue into the medium term at least.”
Key Issues for the New Parliament 2010, Paul Bolton
![Page 5: Zabbix - Beyond the Norm!](https://reader034.fdocuments.in/reader034/viewer/2022051506/58739c321a28ab87318c3b6f/html5/thumbnails/5.jpg)
Background – Reduce Travel
• In parallel with this was the desire to reduce/eliminate the need to reboot remote/local devices that had “frozen” with out travelling “for hours” to site.
• In particular “frozen” remote routers with the obvious question - How do we reboot if the internet connection is gone?
![Page 6: Zabbix - Beyond the Norm!](https://reader034.fdocuments.in/reader034/viewer/2022051506/58739c321a28ab87318c3b6f/html5/thumbnails/6.jpg)
Overall Aims
• To save energy
• To save time
To save Money
![Page 7: Zabbix - Beyond the Norm!](https://reader034.fdocuments.in/reader034/viewer/2022051506/58739c321a28ab87318c3b6f/html5/thumbnails/7.jpg)
General Objectives
• Scalable - Zabbix – 1000s of sensors and sites
• Central control as much as possible
• As Plug ‘n’ Play as possible – less site time
• Minimal Overhead – Network
– Processing – contradictory in certain contexts
• Cost Effective – Zabbix
• Resilient – Zabbix proxy
• Proof Of Concept – saves time & money
![Page 8: Zabbix - Beyond the Norm!](https://reader034.fdocuments.in/reader034/viewer/2022051506/58739c321a28ab87318c3b6f/html5/thumbnails/8.jpg)
Initial Results
• Devices & Zabbix gave time savings for remote unmanned sites as in reboot frozen device of 99%
• Temperature monitoring allowed boilers at various sites to be adjusted – come on later turn off earlier – saving energy consumption and money
![Page 9: Zabbix - Beyond the Norm!](https://reader034.fdocuments.in/reader034/viewer/2022051506/58739c321a28ab87318c3b6f/html5/thumbnails/9.jpg)
Research
• A few off the shelf products
• Developing own to reduce long term costs, gain Unique Selling Point and tailor to our and customer needs. Points to Note: – Initial significant higher costs
– Challenging – time consuming
– Rewarding knowledge
– Correct decision in the medium to long term
![Page 10: Zabbix - Beyond the Norm!](https://reader034.fdocuments.in/reader034/viewer/2022051506/58739c321a28ab87318c3b6f/html5/thumbnails/10.jpg)
Brainstorm
• Brainstorming led to the following devices:
• Server – Store, View and Process data
• Remote Hub – Collate data, send to sever
• Sensors – Acquire environmental data
• Actuators – Remotely switch devices on/off
![Page 11: Zabbix - Beyond the Norm!](https://reader034.fdocuments.in/reader034/viewer/2022051506/58739c321a28ab87318c3b6f/html5/thumbnails/11.jpg)
Why
• Proven Track record
• Continual development
• Scalable, Flexible, Reliable
• Professional & community support
• Our previous experience
ZABBIX ?
![Page 12: Zabbix - Beyond the Norm!](https://reader034.fdocuments.in/reader034/viewer/2022051506/58739c321a28ab87318c3b6f/html5/thumbnails/12.jpg)
Pi-Fi Hub
• Raspberry Pi model B v2
• Zabbix 2.x Proxy & Agent
• 12v or Solar Power
• Encrypted Serial RF up to 2km*
Pi-Fi Hub
www.mvdigital.co.uk
![Page 13: Zabbix - Beyond the Norm!](https://reader034.fdocuments.in/reader034/viewer/2022051506/58739c321a28ab87318c3b6f/html5/thumbnails/13.jpg)
Sensor - PiFiMon
• 3.3v, solar or 2 year lithium bat*
• Encrypted Serial RF up to 2km* • temperature, humidity, light • tilt, vibration, contact • analog and digital reading etc.
Sleep/Active/Sleep profile
PiMon
www.mvdigital.co.uk
![Page 14: Zabbix - Beyond the Norm!](https://reader034.fdocuments.in/reader034/viewer/2022051506/58739c321a28ab87318c3b6f/html5/thumbnails/14.jpg)
Actuator - PiFiKontrol
• 5v or Solar
• Switch 12v power
• Encrypted Serial RF up to 2km*
• Awake/Passive profile www.mvdigital.co.uk
Pi-FiKon
![Page 15: Zabbix - Beyond the Norm!](https://reader034.fdocuments.in/reader034/viewer/2022051506/58739c321a28ab87318c3b6f/html5/thumbnails/15.jpg)
ZABBIX SERVER
Pi-Fi Hub
PiMon
PiMon
Pi-Fikon
OpenVPN
3G/SMS/Tweet
Pi-Fikon
Example Site
Serial RF
Serial RF
![Page 16: Zabbix - Beyond the Norm!](https://reader034.fdocuments.in/reader034/viewer/2022051506/58739c321a28ab87318c3b6f/html5/thumbnails/16.jpg)
Very Early Example
![Page 17: Zabbix - Beyond the Norm!](https://reader034.fdocuments.in/reader034/viewer/2022051506/58739c321a28ab87318c3b6f/html5/thumbnails/17.jpg)
Monitoring
• During the journey it became apparent that Zabbix monitoring would be in three areas: – Research and design
– Infrastructure
– Sensors & Actuators
• 30 mins to briefly discuss each one
• One challenge from each and how we are currently tackling/overcoming them.
![Page 18: Zabbix - Beyond the Norm!](https://reader034.fdocuments.in/reader034/viewer/2022051506/58739c321a28ab87318c3b6f/html5/thumbnails/18.jpg)
General Approach
What
Why
How
Respond
Issues
Config
![Page 19: Zabbix - Beyond the Norm!](https://reader034.fdocuments.in/reader034/viewer/2022051506/58739c321a28ab87318c3b6f/html5/thumbnails/19.jpg)
Research & Design
![Page 20: Zabbix - Beyond the Norm!](https://reader034.fdocuments.in/reader034/viewer/2022051506/58739c321a28ab87318c3b6f/html5/thumbnails/20.jpg)
R & D Example
• To aid R & D we needed to record various operational events including:
• Receiving values from sensors (PiMon)
• Sending commands to actuators (PiKontrol)
• Simple reliability test example:
– Send switch OFF command
– TEST : Successful Coms or/and command execution
![Page 21: Zabbix - Beyond the Norm!](https://reader034.fdocuments.in/reader034/viewer/2022051506/58739c321a28ab87318c3b6f/html5/thumbnails/21.jpg)
R & D - Actuator 1. Switch OFF command sent
Zabbix sender – command sent – count key = sendOFF
2. ACK as Expected - yes or no?
Zabbix sender – expACK = yes – count key= expACKyes
Zabbix sender – expACK = no – count key = expACKno
Aim for and expect sendOFF count = expACKyes count
= COMMS AND STATUS APPEARS OK
![Page 22: Zabbix - Beyond the Norm!](https://reader034.fdocuments.in/reader034/viewer/2022051506/58739c321a28ab87318c3b6f/html5/thumbnails/22.jpg)
R & D - Actuator
Traceback (most recent call last): File "writeSERIALnewD.py", line 120, in <module> Ser.write(ans[0:9] + "O") NameError: name 'Ser' is not defined
![Page 23: Zabbix - Beyond the Norm!](https://reader034.fdocuments.in/reader034/viewer/2022051506/58739c321a28ab87318c3b6f/html5/thumbnails/23.jpg)
Infrastructure
![Page 24: Zabbix - Beyond the Norm!](https://reader034.fdocuments.in/reader034/viewer/2022051506/58739c321a28ab87318c3b6f/html5/thumbnails/24.jpg)
Infrastructure Example - OpenVPN
ZABBIX Agent
ZABBIX Server
Dedicated Server running OpenVZ Containers
OpenVPN
Use ObservIT OpenVPN setup for example of how we monitor parts of the virtual infrastructure.
3G / ADSL Links
ZABBIX Agent
Remote Site
![Page 25: Zabbix - Beyond the Norm!](https://reader034.fdocuments.in/reader034/viewer/2022051506/58739c321a28ab87318c3b6f/html5/thumbnails/25.jpg)
OpenVPN
• Separate Templates for Client, Server & Overall
• Parse Log Files for keywords –”reset” etc
• Scripts – ps aux – extract – RSS & VSZ
• Zabbix Sender
• Telnet! – OpenVPN Management Interface
– Use Comman Names (CN) and commands such as “status”
![Page 26: Zabbix - Beyond the Norm!](https://reader034.fdocuments.in/reader034/viewer/2022051506/58739c321a28ab87318c3b6f/html5/thumbnails/26.jpg)
OpenVPN – Challenge 1
Many Physical
Hosts
OpenVPN Server
One Zabbix Agent
ZABBIX Agent
ZABBIX Server
Many Physical Hosts to One Agent to Many Hosts to Many Templates
Host 1
Host 2
Host 3
One Zabbix Server
Client Template
VPN Server
Server Template
OpenVPNTemplate
OpenVZ Containers
![Page 27: Zabbix - Beyond the Norm!](https://reader034.fdocuments.in/reader034/viewer/2022051506/58739c321a28ab87318c3b6f/html5/thumbnails/27.jpg)
OpenVPN – Challenge 1
Server Template ClientTemplate
Double the number of items for needed values
https://www.zabbix.com/forum/showthread.php?t=42265
![Page 28: Zabbix - Beyond the Norm!](https://reader034.fdocuments.in/reader034/viewer/2022051506/58739c321a28ab87318c3b6f/html5/thumbnails/28.jpg)
OpenVPN – Challenge 1
Pass a list of clients (denoted as numbers) that we want values for rather than one pass per client.
Back to a one to many situation
A More suitable Solution:
![Page 29: Zabbix - Beyond the Norm!](https://reader034.fdocuments.in/reader034/viewer/2022051506/58739c321a28ab87318c3b6f/html5/thumbnails/29.jpg)
Actuators – PiKon &
Sensors - PiMon
![Page 30: Zabbix - Beyond the Norm!](https://reader034.fdocuments.in/reader034/viewer/2022051506/58739c321a28ab87318c3b6f/html5/thumbnails/30.jpg)
ZABBIX SERVER
Pi-Fi Hub
Pi-Fikon
OpenVPN
Pikon
Actuators - PiKon
ZABBIX Agent
Serial RF
Zabbix Hosts
3G/SMS/Tweet
![Page 31: Zabbix - Beyond the Norm!](https://reader034.fdocuments.in/reader034/viewer/2022051506/58739c321a28ab87318c3b6f/html5/thumbnails/31.jpg)
Actuator - Serial RF Command
aAVxxxxxxON Unique PiKon
Device ID
Actuator/Switch Command
ON or OFF
![Page 32: Zabbix - Beyond the Norm!](https://reader034.fdocuments.in/reader034/viewer/2022051506/58739c321a28ab87318c3b6f/html5/thumbnails/32.jpg)
Actuators - PiKon
• Agent on PiFiHub – Remote Command Script – allowing the sending of serial RF actuator/switch command to PiKon - on/off of CONNECTED host
– Can be automated if no response in 5mins etc the send SMS etc to reboot.
![Page 33: Zabbix - Beyond the Norm!](https://reader034.fdocuments.in/reader034/viewer/2022051506/58739c321a28ab87318c3b6f/html5/thumbnails/33.jpg)
Challenge 2
• Each site may use many and different PiKon device ids in commands.
• To reduce duplication we wanted to reuse actuator switch script by passing appropriate device id host level macro.
• Client 1 Example:
– {$DEVID} = AA
– /externalscripts/writeSERIAL.py {DEVID} ON
![Page 34: Zabbix - Beyond the Norm!](https://reader034.fdocuments.in/reader034/viewer/2022051506/58739c321a28ab87318c3b6f/html5/thumbnails/34.jpg)
Challenge 2
The link for macro is the hostname
/externalscripts/writeSERIAL.py {DEVID} ON
Pi-Fikon: AA
![Page 35: Zabbix - Beyond the Norm!](https://reader034.fdocuments.in/reader034/viewer/2022051506/58739c321a28ab87318c3b6f/html5/thumbnails/35.jpg)
Challenge 2
• At present it appears that the passing of host level macros to the script is not possible.
• HOWEVER… all is not lost… Look what Zabbix 2.2 will do:
“Starting with Zabbix 2.2, user macros are supported in script commands.” • https://www.zabbix.com/documentation/2.2/manual/web_inte
rface/frontend_sections/administration/scripts
![Page 36: Zabbix - Beyond the Norm!](https://reader034.fdocuments.in/reader034/viewer/2022051506/58739c321a28ab87318c3b6f/html5/thumbnails/36.jpg)
Challenge 2
• At present we store (in a text file) the unique site commands at the PiFiHub (Zabbix Agent) and have “standard” script commands with parameters Example:
Script/Remote Command Line Number Line Content
externalscripts/writeSERIAL.py 1 ON 1 AA
externalscripts/writeSERIAL.py 1 OFF 1 AA
externalscripts/writeSERIAL.py 3 ON 3 AB
externalscripts/writeSERIAL.py 4 OFF 4 Etc….
• Issue: All scripts available for all host group – Which One to pick etc.
![Page 37: Zabbix - Beyond the Norm!](https://reader034.fdocuments.in/reader034/viewer/2022051506/58739c321a28ab87318c3b6f/html5/thumbnails/37.jpg)
Sensor - Serial RF Value
aAVTMPA23.50 Unique
Device ID
Zabbix Key Value
Type Sensor Number
![Page 38: Zabbix - Beyond the Norm!](https://reader034.fdocuments.in/reader034/viewer/2022051506/58739c321a28ab87318c3b6f/html5/thumbnails/38.jpg)
Sensors - PiMon
ZABBIX Agent
Pi-Fi Hub
ZABBIX SERVER OpenVPN
PiMon
PiMon
Serial RF
Zabbix Items
Item Values
![Page 39: Zabbix - Beyond the Norm!](https://reader034.fdocuments.in/reader034/viewer/2022051506/58739c321a28ab87318c3b6f/html5/thumbnails/39.jpg)
Sensors - PiMon
• PiMon wakes up at programmed intervals and sends back values to PiFiHub
• Script on PiFiHub reads every second Serial Coms and parses for keys & values
• Zabbix Sender sends keys and values back to the server.
![Page 40: Zabbix - Beyond the Norm!](https://reader034.fdocuments.in/reader034/viewer/2022051506/58739c321a28ab87318c3b6f/html5/thumbnails/40.jpg)
Challenge 3
• Wanted to use host macros for: – Device ID
– Type
– Sensor
• Then apply to PiMon/sensor template as keys for zabbix trapper items.
• However: “user macros (variables) are supported in item key
parameters, not as replacement for item keys themselves”
https://www.zabbix.com/forum/showthread.php?t=42239&highlight=macros+keys
![Page 41: Zabbix - Beyond the Norm!](https://reader034.fdocuments.in/reader034/viewer/2022051506/58739c321a28ab87318c3b6f/html5/thumbnails/41.jpg)
Challenge 3
• In this instance we didn`t look for a workaround as time was pressing so we added each item individually.
![Page 42: Zabbix - Beyond the Norm!](https://reader034.fdocuments.in/reader034/viewer/2022051506/58739c321a28ab87318c3b6f/html5/thumbnails/42.jpg)
Challenge 3
![Page 43: Zabbix - Beyond the Norm!](https://reader034.fdocuments.in/reader034/viewer/2022051506/58739c321a28ab87318c3b6f/html5/thumbnails/43.jpg)
Any ideas?
![Page 44: Zabbix - Beyond the Norm!](https://reader034.fdocuments.in/reader034/viewer/2022051506/58739c321a28ab87318c3b6f/html5/thumbnails/44.jpg)
Future Paths
• Research API
Wishlist
• Macros as keys
![Page 45: Zabbix - Beyond the Norm!](https://reader034.fdocuments.in/reader034/viewer/2022051506/58739c321a28ab87318c3b6f/html5/thumbnails/45.jpg)
Speak Later
• If you need to speak to me after I look like this:
![Page 46: Zabbix - Beyond the Norm!](https://reader034.fdocuments.in/reader034/viewer/2022051506/58739c321a28ab87318c3b6f/html5/thumbnails/46.jpg)
References
• Bolton, P. (2010) Energy price rises and fuel poverty [Internet]. House of Commons Library Research. Available from: <http://www.parliament.uk/documents/commons/lib/research/key_issues/Key%20Issues%20Energy%20price%20rises%20and%20fuel%20poverty.pdf> [Accessed 3rd June 2012].
• http://openvpn.net/index.php/open-source/documentation/miscellaneous/79-management-interface.html
• http://blog.zabbix.com/multiple-servers-for-active-agent-sure/858/
• https://www.zabbix.com/documentation/2.0/manual/config/macros/usermacros
• https://www.zabbix.com/documentation/2.2/manual/web_interface/frontend_sections/administration/scripts