I recommend using runtimeFlags field to determine that node is completely unreachable, like this:
Also few comments on script itself - purely style/clarity, not functionality:
1. You may use direct comparison instead of regexp match if you are loking for exact match, i.e.
(newstate == "Down")
instead of
(newstate imatch "Down")
2. No need for checking status twice, just can just use else:
Best regards,
Victor
Code Select
if (($node->icmpresponse & 4) != 0)
// state is "down"
Also few comments on script itself - purely style/clarity, not functionality:
1. You may use direct comparison instead of regexp match if you are loking for exact match, i.e.
(newstate == "Down")
instead of
(newstate imatch "Down")
2. No need for checking status twice, just can just use else:
Code Select
if ($node->icmpresponse == "no") {
}
else {
}
Best regards,
Victor