Fix the liveness check in node_is_alive
Previously if a node wasn't reachable whe would get an UNKNOWN error. instead of a CRITICAL error. ``` NODEISALIVE UNKNOWN - Connection failed for all provided endpoints ``` We now get the correct error. ``` NODEISALIVE CRITICAL - This node is not alive (patroni is not running). | is_alive=0;;@0 ```
This commit is contained in:
parent
46dd431775
commit
20d9d48d78
|
@ -73,7 +73,7 @@ class PatroniResource(nagiosplugin.Resource):
|
||||||
return r.json()
|
return r.json()
|
||||||
except requests.exceptions.JSONDecodeError:
|
except requests.exceptions.JSONDecodeError:
|
||||||
return None
|
return None
|
||||||
raise nagiosplugin.CheckError("Connection failed for all provided endpoints")
|
raise APIError("Connection failed for all provided endpoints")
|
||||||
|
|
||||||
|
|
||||||
HandleUnknown = Callable[[nagiosplugin.Summary, nagiosplugin.Results], Any]
|
HandleUnknown = Callable[[nagiosplugin.Summary, nagiosplugin.Results], Any]
|
||||||
|
|
Loading…
Reference in a new issue