Compare commits
3 Commits
38e43b46c3
...
e88b97f3a9
| Author | SHA1 | Date | |
|---|---|---|---|
| e88b97f3a9 | |||
| 709c9cb73e | |||
| f41c5176be |
@@ -249,6 +249,8 @@ def getOutputColours(node_information):
|
|||||||
daemon_state_colour = ansiprint.yellow()
|
daemon_state_colour = ansiprint.yellow()
|
||||||
elif node_information["daemon_state"] == "dead":
|
elif node_information["daemon_state"] == "dead":
|
||||||
daemon_state_colour = ansiprint.red() + ansiprint.bold()
|
daemon_state_colour = ansiprint.red() + ansiprint.bold()
|
||||||
|
elif node_information["daemon_state"] == "fenced":
|
||||||
|
daemon_state_colour = ansiprint.red()
|
||||||
else:
|
else:
|
||||||
daemon_state_colour = ansiprint.blue()
|
daemon_state_colour = ansiprint.blue()
|
||||||
|
|
||||||
|
|||||||
@@ -241,7 +241,9 @@ def getNodeHealth(zkhandler, node_list):
|
|||||||
node_health_messages.append(f"'{entry['name']}': {entry['message']}")
|
node_health_messages.append(f"'{entry['name']}': {entry['message']}")
|
||||||
|
|
||||||
node_health_entry = {
|
node_health_entry = {
|
||||||
"health": int(node_health_value),
|
"health": int(node_health_value)
|
||||||
|
if isinstance(node_health_value, int)
|
||||||
|
else node_health_value,
|
||||||
"messages": node_health_messages,
|
"messages": node_health_messages,
|
||||||
}
|
}
|
||||||
node_health[node] = node_health_entry
|
node_health[node] = node_health_entry
|
||||||
|
|||||||
@@ -80,6 +80,11 @@ def entrypoint():
|
|||||||
# Connect to Zookeeper and return our handler and current schema version
|
# Connect to Zookeeper and return our handler and current schema version
|
||||||
zkhandler, _ = pvchealthd.util.zookeeper.connect(logger, config)
|
zkhandler, _ = pvchealthd.util.zookeeper.connect(logger, config)
|
||||||
|
|
||||||
|
logger.out("Waiting for node daemon to be operating", state="s")
|
||||||
|
while zkhandler.read(("node.state.daemon", config["node_hostname"])) != "run":
|
||||||
|
sleep(5)
|
||||||
|
logger.out("Node daemon in run state, continuing health daemon startup", state="s")
|
||||||
|
|
||||||
# Define a cleanup function
|
# Define a cleanup function
|
||||||
def cleanup(failure=False):
|
def cleanup(failure=False):
|
||||||
nonlocal logger, zkhandler, monitoring_instance
|
nonlocal logger, zkhandler, monitoring_instance
|
||||||
|
|||||||
Reference in New Issue
Block a user