Development
This commit is contained in:
parent
4be98fd794
commit
ef4bdef838
14 changed files with 780 additions and 1419 deletions
|
|
@ -744,11 +744,20 @@ def print_table(status):
|
|||
# ===================================================================
|
||||
|
||||
if __name__ == "__main__":
|
||||
import argparse
|
||||
parser = argparse.ArgumentParser(description="Routlin health checks")
|
||||
group = parser.add_mutually_exclusive_group(required=True)
|
||||
group.add_argument("--collect", action="store_true", help="Run checks and write .health (used by timer)")
|
||||
group.add_argument("--view", action="store_true", help="Run checks, write .health, and print results")
|
||||
args = parser.parse_args()
|
||||
|
||||
try:
|
||||
with open(CONFIG_FILE) as f:
|
||||
data = json.load(f)
|
||||
except Exception as ex:
|
||||
print(f"Error loading {CONFIG_FILE}: {ex}", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
_, status = run_and_write(data)
|
||||
print_table(status)
|
||||
if args.view:
|
||||
print_table(status)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue