Coda Protocol: How to monitor Coda node

Bit Cat
Bit Cat
Jan 1 · 4 min read

When running a Coda node, whether it is used for Produce block node or Snark node, it is most important to ensure that the node is not online for 24 hours. So how can you ensure that all Coda nodes are running properly? This article Bit Cat shares the approach we are using.

Get the current block height script (Coda node)

After Coda starts saving nodes, you can use:

coda client status

The command obtains the relevant information of the Coda node, such as:

In the result information, you can see a piece of data: Block height: 11257, this is the current node block height information.

Configure Zabbix Agent (coda node)

1. Installation
Install Zabbix Agent on the Coda node server. For details, see the Zabbix official website.

2. Connect
Configure Zabbix Agent to connect to Zabbix Server.

sudo vim /etc/zabbix/zabbix-agent.conf

Ensure that the following fields are configured correctly:

Server = {Zabbix Server address}
ServerActive = {Zabbix Server address}
Hostname = {Zabbix Agent hostname}

3. Configuration parameters
Configure user-defined parameters for Zabbix Agent.

sudo vim /etc/zabbix/zabbix-agent.conf

Add one of the following configuration fields:

UserParameter = get_height, coda client status | grep ‘Block height:’

Where get_height is a user-defined script used to get native Coda blocks.

4. start
Restart Zabbix Agent for the configuration to take effect

sudo systemctl restart zabbix-agent

Configure Zabbix Server (Zabbix Server)

1. Installation
Install Zabbix Server on the Zabbix Server. For details, see the Zabbix official website.

2. Test
Log in to the server where Zabbix Server is installed, and execute the following command to test whether the Zabbix Agent is successfully configured.

sudo zabbix_get -s {Zabbix Agent address} -k get_height

It can be found that the block height information of the Coda Node was successfully obtained. If Zabbix Server does not have zabbix_get installed, execute the following command to install it:

sudo apt install zabbix-get

3. Configuration:
1) Add Coda node host
Pay attention to the following important parameters and save after filling in:

Host name: Feel free to fill in
Group: Choose the right one
Agent interface: fill in the IP and port of the monitored Zabbix agent

2) Create a monitoring item
The configuration in this article uses the template function of Zabbix. After the template is created, it is bound to the monitored Coda host. You can also directly create the corresponding monitor and trigger in the resources of the Coda host.

Pay attention to the following important parameters and save after filling in:

Name: Feel free to fill in
Key: The same as configured in the configuration file in Zabbix Agent.
Updated: Fill in demand, Coda current average a few minutes out of a block, so fill in 15–30 minutes is reasonable.

3) Create a trigger
Pay attention to the following important parameters and save after filling in:

Name: Feel free to fill in
Severity: select on demand
Expression: The meaning shown in the figure below is that if the value of get_height does not change within the monitoring time, the trigger condition is satisfied.

4) Create action
The creation action can adopt the corresponding processing method when the height of the Coda node block is not updated. You can send emails, nails, and telephones to configure it according to your actual situation.

Pay attention to the following important parameters and save after filling in:

Condition: On demand but with a severity level higher than the trigger condition above.
Operation: The operation can configure the mailbox and phone, which need to be configured in the Zabbix user group.

After completing the above series of configuration, you can clearly know the status of Coda’s nodes. You can also follow the actual situation to perform another line of operation configuration, such as what operations are performed when the Coda node block height is not updated.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade