feat: add various infrastructure check and automation scripts
This commit is contained in:
19
scripts/test_heimdall_http.py
Normal file
19
scripts/test_heimdall_http.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import paramiko
|
||||
import sys
|
||||
|
||||
sys.stdout.reconfigure(encoding='utf-8')
|
||||
c = paramiko.SSHClient()
|
||||
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
c.connect('140.44.4.71', username='snarf', key_filename=r'C:\Users\Snarf\.ssh\id_ed25519_snarfnet', timeout=10)
|
||||
|
||||
cmd = "curl -sk https://heimdall.snarfnet.net | grep -o -E 'item-title[^<]+' | head -10"
|
||||
_, o, e = c.exec_command(cmd)
|
||||
print("Heimdall HTML Tiles rendered:\n", o.read().decode().strip())
|
||||
|
||||
# Also verify HTTP status code
|
||||
cmd2 = "curl -sk -o /dev/null -w '%{http_code}' https://heimdall.snarfnet.net"
|
||||
_, o2, _ = c.exec_command(cmd2)
|
||||
print("HTTP status code:", o2.read().decode().strip())
|
||||
|
||||
c.close()
|
||||
|
||||
Reference in New Issue
Block a user