feat: add infrastructure automation and diagnostic scripts for Zabbix, Nginx, and Authentik
This commit is contained in:
23
scripts/check_zabbix_cluster.py
Normal file
23
scripts/check_zabbix_cluster.py
Normal file
@@ -0,0 +1,23 @@
|
||||
import paramiko
|
||||
|
||||
ssh = paramiko.SSHClient()
|
||||
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
# Let's check Spaceport master 140.44.4.41 for CoreDNS / Kubernetes or Pi-hole
|
||||
ssh.connect('140.44.4.41', username='root', key_filename=r'C:\Users\Snarf\.ssh\id_ed25519_snarfnet', timeout=10)
|
||||
|
||||
def run(cmd):
|
||||
print(f">>> {cmd}")
|
||||
_, o, e = ssh.exec_command(cmd)
|
||||
out = o.read().decode().strip()
|
||||
err = e.read().decode().strip()
|
||||
if out:
|
||||
print(out)
|
||||
if err:
|
||||
print("[stderr]", err)
|
||||
|
||||
run("kubectl get svc -n monitoring")
|
||||
run("kubectl get pods -n monitoring")
|
||||
run("kubectl logs deployment/zabbix-zabbix-server -n monitoring -c zabbix-server --tail=50")
|
||||
|
||||
ssh.close()
|
||||
|
||||
Reference in New Issue
Block a user