Hi,
Is it possible to use the API to get a list of nodes which have become unavailable due to failed healthchecks? I've been unable to find how to do this from the API documentation (which makes me think it's impossible) but I thought I'd ask here to double check before giving up.
To clarify, I'm not looking for nodes which have been put into "disabled" or "draining" states. It's possible to get this information from the command line client using: "zcli stats nodes" and looking at the State column but I'm unable to use this to solve my current use case which is why I hoped the Rest API would have the same information available.
Cheers,
Alan
Solved! Go to Solution.
With version 9.5 you can look at the per_pool_node statistics for a state value of dead
{
"statistics": {
"bytes_from_node": 0,
"bytes_to_node": 0,
"current_conn": 0,
"current_requests": 0,
"errors": 3,
"failures": 2,
"idle_conns": 0,
"new_conn": 0,
"node_port": 80,
"pooled_conn": 0,
"response_max": 0,
"response_mean": 0,
"response_min": 0,
"state": "dead",
"total_conn": 0
}
}
With version 9.5 you can look at the per_pool_node statistics for a state value of dead
{
"statistics": {
"bytes_from_node": 0,
"bytes_to_node": 0,
"current_conn": 0,
"current_requests": 0,
"errors": 3,
"failures": 2,
"idle_conns": 0,
"new_conn": 0,
"node_port": 80,
"pooled_conn": 0,
"response_max": 0,
"response_mean": 0,
"response_min": 0,
"state": "dead",
"total_conn": 0
}
}
Thanks for the quick reply. It's great to know it's possible on a newer version of Stingray. Our servers are currently hosted on Joyent who only support up to 9.3, I'll contact them about any possible issues with us manually upgrading to 9.5 or above.
Cheers,
Alan
Its possible the value is in SOAP or SNMP (just not sure with 9.3 off the top of my head)
Take a look at SNMP perPoolNodeState OID .1.3.6.1.4.1.7146.1.2.4.6.1.6
perPoolNodeState OBJECT-TYPE
SYNTAX INTEGER { alive(1), dead(2), unknown(3), draining(4) }
MAX-ACCESS read-only
STATUS current
DESCRIPTION "The state of this node."
or
nodeInet46State OID .1.3.6.1.4.1.7146.1.2.4.4.1.5
nodeInet46State OBJECT-TYPE
SYNTAX INTEGER { alive(1), dead(2), unknown(3) }
MAX-ACCESS read-only
STATUS current
DESCRIPTION "The state of this node."