diff --git a/sijapi.15s.py b/sijapi.15s.py index 1e1f281..56521d6 100644 --- a/sijapi.15s.py +++ b/sijapi.15s.py @@ -1,13 +1,21 @@ #!/usr/bin/env python3 -# tailscaled2 -# SIJ (Updated) -# ioflux -# Monitors Tailscale, VPN, and server status across multiple servers. +# sijapi +# sij.law +# sij.ai +# Monitors Tailscale, VPN, and sijapi server and Postgres status across multiple servers. # true -# true -# true +# false +# false # 15 +# STEP 1: Update this path to point to your sijapi directory: +sijapi_dir = '/Users/sij/workshop/sijapi' + +# STEP 2: Ensure ./sijapi/config/sys.yaml exists in your sijapi directory and contains your correct configuration. You can work off the template provided at sys.yaml-example. +config_yaml = f'{sijapi_dir}/sijapi/config/sys.yaml' + +# STEP 3: Install 'vitals' (https://sij.ai/sij/vitals) in your server(s) PATH(s). + import subprocess import json import yaml @@ -29,11 +37,6 @@ for old_script in glob.glob(os.path.join(temp_dir, 'swiftbar_vpn_*.sh')): except OSError: pass # Ignore errors in cleanup -# STEP 1: Update this path to point to your sijapi directory: -sijapi_dir = '/Users/sij/workshop/sijapi' - -# STEP 2: Ensure ./sijapi/config/api.yaml exists in your sijapi directory and contains your correct configuration. You can work off the template provided at api.yaml-example. -config_yaml = f'{sijapi_dir}/sijapi/config/api.yaml' with open(config_yaml, 'r') as stream: config = yaml.safe_load(stream) servers = config['POOL'] @@ -210,6 +213,9 @@ for server_info in server_infos: postgres_symbol = '◆' if server_info['postgres_ok'] else '◇' print(f"{health_symbol} Health {postgres_symbol} Postgres") vpn_path = server_info['vpn_path'] + print() + print('---') + print() print() print('---')