I am trying to monitor my Master Node through Domoticz. There is a website where you can check the status of each Master Node, however the JSON API is pretty basic so I have to find my Master Node in the complete list to monitor the status.
The URL is http://api-rupx.mn.zone/masternodes
A snippet of example output is added to the bottom of this post.
I already managed to look up the complete list, but now I have to filter out only my own Master Node but I'm missing scripting knowledge/experience how to do that.
I want to be able to find my node based on IP or Address and then retrieve the Status
I don't know if something like a for loop is needed to look through all nodes, or if I can somehow directly search on IP or Address and I can just output the Status.
Thanks for your help!
Wesley
Code: Select all
{
"nodes": [
{
"ip": "1.1.1.1",
"port": 9020,
"address": "123456",
"protocol": "70002",
"wallet": "4.0.0",
"status": "ENABLED",
"active_time": 218054,
"last_seen": 1523211508,
"last_paid": 1523206405,
"paid_block": 0,
"listen": 1,
"voting": 0,
"blocks": 80022
},
{
"ip": "2.2.2.2",
"port": 9020,
"address": "234567",
"protocol": "70002",
"wallet": "4.0.0",
"status": "ENABLED",
"active_time": 17512,
"last_seen": 1523211413,
"last_paid": 0,
"paid_block": 0,
"listen": 1,
"voting": 0,
"blocks": 60408
},
{
"ip": "3.3.3.3",
"port": 9020,
"address": "345678",
"protocol": "70002",
"wallet": "4.0.0",
"status": "ENABLED",
"active_time": 415347,
"last_seen": 1523211492,
"last_paid": 1523207099,
"paid_block": 0,
"listen": 1,
"voting": 0,
"blocks": 73137
}
],
"statuses": [
{
"status": "ENABLED",
"count": 752
}
],
"total_nodes": 752,
"blocks": 0,
"error": "",
"tech": "pivx",
"api_ver": "1.5.5",
"time": 1523211739
}