Zabbix template for Symbol nodes

UPDATED July the 14th 2021

Hello,
I just made a Zabbix template to monitor my Symbol node, I’m sharing it in case anyone find it useful.

It can be used to send alarms to your email/Telegram/whatever, it can also generate nice graphs like these ones:

I’m assuming you already have your Zabbix server, your Zabbix agent, your media types in place, there’s a lot of documentation online covering that.

I developed it on Zabbix 5.0 but I guess it should work without issues on other versions too.

The first step is creating a Bash script on your node to gather informations, I called it /etc/zabbix/symbol_info.sh

You have to modify the 3 variables at the top according to your configuration:
the directory where you installed your Symbol node software;
a working directory writable by the user running your Symbol node but not by others;
your Symbol account address.

Please, dont forget to make the script executable:

sudo chmod a+x /etc/zabbix/symbol_info.sh

The script requires: wget, jq, symbol-cli and num-utils package to be installed on your node.

Once the script is in place, you must give the zabbix user the permission to run it impersonating the symbol user (or whatever the user you are running your node is called). To do so create the file /etc/sudoers.d/zabbix with this content:

zabbix ALL=(symbol)NOPASSWD:/etc/zabbix/symbol_info.sh

Probably your sudo will complain if you don’t give it correct permissions:

sudo chmod 0640 /etc/sudoers.d/zabbix

Now it’s time to inform the Zabbix agent about the existence of this script, let’s create a new file /etc/zabbix/zabbix_agentd.d/nem_symbol.conf containing:

UserParameter=symbol_info[*],sudo -u symbol /etc/zabbix/symbol_info.sh $1 $2

This means that when Zabbix agent receives a symbol_info[] request from the server it must call the script, impersonating symbol user, and passing it the parameters (up to two) on the command line.

If you have lots of delegators you better increase the timeout for running the script. This can be done modifying this line in /etc/zabbix/zabbix_agentd.conf file:
Timeout=5
I suggest the value 30 wich is the maximum allowed.

Now restart Zabbix agent:

sudo systemctl restart zabbix-agent

Zabbix agent is ready, the next step is to import this template via Zabbix web interface and add it to the host.

Some items need time to show some value but most of them will work in few minutes. In the meantime you can look at Zabbix agent logs (/var/log/zabbix/zabbix_agentd.log) to spot any problem.

6 Likes

Thank you to XHarvesting for using my template and writing a blog post about it: https://symbolblog.com/article/symbol-node-monitoring-with-zabbix/

I know setting up Zabbix is not an easy task and can be difficult at start.
You can contact me for any issue about that.

1 Like