A script to access the storagenode stats for monitoring. (egress, ingress, disk, upToDate)

I have written a simple bash script, that prints out the egress, ingress, disk and upToDate stats using the dashboard api.

After creating the required Zabbix UserParameters it allows me to collect these stats and display them in Grafana.

1 Like

Welcome to the forum!

How is this different from the cli dashboard ?

I think it is not possible to access the data in bytes as plain text there like it is needed for my monitoring solution. But I am fairly new to the topic.

Have you taken a look at this

I like the script. It’s nice and simple.

However, I needed to add a question mark in the jq parsing statement in order to remove a Cannot iterate over null (null) error.

satellites=$(curl -s 127.0.0.1:14002/api/dashboard | jq -r ".data.satellites[]?.id")

I have zero knowledge in that thread but couldn’t you add parameters to that existing grafana GUI.

The successrate.sh script parses the node’s log file. It doesn’t use the api. The above script uses the api. The api is reading the log term sqlite database, while the docker node logs are short term.

If a given node’s docker container is stopped, removed, and replaced, the successrate.sh script will not capture the complete node’s historical record. In the case of the OP’s script, the replacement of a docker container will not reset the statistics since it relies on the api… which is reading the node’s database.

1 Like

Thank you for your indication. I have added the question marks. (The problem is probably caused by different versions of jq. Mine also tolerates the question mark :smiley: )

1 Like