пятница, 16 января 2015 г.

Netgear Stora with connected Arduino and Zabbix

Was able to install Zabbix on my Netgear Stora device. Took some time and setup code modifications were required (because mysql is lower version in Stora as well as some php addons).

Zabbix is very usefull tool to quickly configure the monitoring and notification system with ability to check metric charts and trends and set triggers and actions.

I'm using it now to monitor the free space and overall health of the Netgear Stora device, router traffic (via SNMP) and, what is more important for me - different aspects of Arduino subsystem (I have Arduino Due connected via USB). I've created a PHP script which takes commands as parameters and returns data reported by arduino. Zabbix agent is using this script to get data from Arduino. Currently I monitor RAM usage of my Arduino system (because has a dynamic tree-like memory allocation system for data reported by remote nodes), so that I can see if my Arduino is about to kaboom :) because of too many nodes reporting to the root node or just because of firmware glitch on Arduino, illumination using the photoresistor on one of the nodes (just for testing purposes), here is the chart screenshot


Also I'm collecting number of cycles certain node is unresponsive, so that zabbix can notify me if certain node is not responding anymore. I have plans to use Zabbix way of autodiscovering new nodes and automatically monitoring them, currently I've just added 2 active node manually, here is the configuration of the Zabbix item, Arduino RAM usage in this case.


Below is a config of my zabbix agent. It should be placed as a separate .conf file into zabbix_agentd.conf.d subfolder, but before that you have to uncomment the following line in the main agentd config:

Include=/opt/usr/local/etc/zabbix_agentd.conf.d/*.conf

userparameter_arduino.conf:

UserParameter=arduino.light,/opt/bin/php -f /home/sg_parser/ardu_get.php l 1 3
UserParameter=arduino.ram,/opt/bin/php -f /home/sg_parser/ardu_get.php s 0 3
UserParameter=arduino.cycles[*],/opt/bin/php -f /home/sg_parser/ardu_get.php c $1 3

All of the paramters for ardu_get.php is just to extract the numeric part of certain node, light sensor is on the node 1 for example, while RAM is on the parent or 0 node and cycles can be gathered for any discovered node.

And now non-arduino part of using Zabbix, here is free space on my Stora, Stora CPU usage and traffic via router (using SNMP data). I'm also monitoring mysql load and apache performance.



Комментариев нет:

Отправить комментарий