Zabbix Elrond Metrics
This section is part of Zabbix & Elrond Guide
Now it’s time to start with your node metrics. We recommend that you use ARCSOFT plugin, as it works properly and is up to date.
CUSTOMIZE ZABBIX AGENT
Go first to you host, and connect with ssh, we need to install the plugin to make the agent able to get the nodes data. First install Perl in your host:
sudo apt install perl
Now we need to clone the github repo in your host with:
cd ~ && sudo git clone https://github.com/arcsoft-ro/zabbix-elrond-plugin
In our home we’ll have a zabbix-elrond-plugin folder.
cd ~/zabbix-elrond-plugin && sudo ./install.pl
Once you have it installed your modified agent is ready to send nodes info to your Zabbix Server.
CUSTOMIZE ZABBIX SERVER
We need to download all the github repo in our desktop, because we are connecting to the Zabbix frontend with our Windows or Mac machine and we need a template.
In the right side you have a button Clone or Download, click on download a .ZIP
Once you have your zip on your computer. Unzip it and search for a folder zabbix-elrond-plugin/server-templates
Inside you must see a elrond-template_node-status_zabbix_v4.2.xml file
Now you need to go to Configuration —> Templates and look on the right for an Import button.
Click on Select button to search it on your computer and when done, click on Import.
This process creates a new template in your Zabbix Server with all you need to look at your nodes.
LOOK AT THE TEMPLATE:
Go to Configuration —> Templates and search with the filter Name the word “elrond”. You must see something like this:
If you look inside you will see that it creates an Application (a set of items) and a Discovery Rule. Look inside the discovery rule.
You can see here that in every host that you “Linked” your new Elrond Template it will search and create new Items, Triggers and Graph in intervals of 5m. If you want to understand it better go and look deeply in the item prototypes and trigger prototypes.
LINK YOUR HOST WITH THE TEMPLATE
Go again to Configuration —> Hosts and search for your host, and click on it to see the details.
In the Templates tab of your node you must search to Link new templates, try to write “elrond”
Select it and click on “Update” button, you must see the elrond template on “Linked templates”.
Give to the system about 10 minutes to discover your nodes in the host, make sure that you have the nodes running. It will create items and triggers for every node you will see.
LOOK AT YOUR ITEMS
Go to Configuration —> Hosts to see the list of your hosts, in the row of your node you must see something like that:
Click on “Items” to look at your new items. There will be the items created before by your Linux OS template and now the items created by your Elrond linked template. Use the Subfilter “Applications” and click on “Elrond Node” to see only the items of this Application (remember that on zabbix is a set of items together)
In the list of items you can see some of them as interesting as this example:
You can see that it gets the Node names directly from your zabbix agent. Look that this examples have Triggers definitions. Move your mousse over the word “Triggers” to look at the definitions.
LOOK AT YOUR TRIGGERS
Now you can look at all the triggers that create your linked Elrond template. Go to Configuration —> Hosts and in next to the name of your Host you will see a link “Triggers” click on it to see them.
On this list you can filter by severity, if you think some triggers need to be different, here you are free to play with it. Prefer to have a high priority alert instead of warning, just edit it.
MONITORING DATA OF YOUR NODES
Since here we have been working with definitions of data (item), like containers where Zabbix Server will store datasets of “item-id, timestamp, value” and so on.
Now take a look at the data collected, go to Monitoring —> Latest Data and in the filter select your host and on “Application” field select “Elrond Node”, this way you will look only into data of your nodes.
In this example you are looking at the last data of your “connected peers” number. You can click on the Graph link of the right to see it in a timeline graph. Remember that in the Graph screen you can always select “View As” up-right, and select Values to see all the values collected.
Here it is good that you spend some time playing with this metrics and alerts. Remember that if you have setup the Media types properly you will receive emails and/or telegram alerts about your nodes.
If any of your nodes have troubles that are screened by Zabbix, you will have the alerts in the section Monitoring —> Dashboard.
You can edit your Dashboard to add some graphs of your new node metrics, but we prefer to create visual Dashboard with the tool Grafana as you will see in the next chapter of the Guide.
MONITORING THE BLOCKCHAIN ITSELF
You can monitor stats directly from the blockchain, this is very useful. To do it you’ll need to install an observer node in the same machine as the Zabbix Server. We need this node observer to be configured to be part of metachain.
Change the field DestinationShardAsObserver to the value “metachain” and restart your node.
You must install the zabbix-elrond-plugin also in this machine to ensure that the Agent installed locally in the Server is able to talk with the meta Observer.
After that, with the .zip you had downloaded choose the template elrond-template_blockchain-statistics-zabbix-v4.2 and import it from your zabbix server GUI. You must do it in the Configuration/templates section.
After that you need to edit the macros section of the template (something like ENV VARIABLES).
Go to Configuration/templates section and choose the Template with name “Template App Elrond Blockchain Statistics”. Inside you have a tab Macros, click on it.
You must setup your METAURL according of where is your meta observer.
Finally in the local host (that you must had created in Zabbix to monitor the Zabbix server itself), you must apply this new template, only in it. Is very important don’t import this template in all your validators hosts, only the host with the meta observer (zabbix server).
This new template will create dinamically new items for the blockchain that you can use into a graph in Zabbix or in Grafana.