feat(power): complete Phase 7 Power Resilience & UPS Automation deployment and verification
This commit is contained in:
20
scripts/check_nut_services.py
Normal file
20
scripts/check_nut_services.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import paramiko
|
||||
import sys
|
||||
|
||||
sys.stdout.reconfigure(encoding='utf-8')
|
||||
|
||||
def main():
|
||||
ssh = paramiko.SSHClient()
|
||||
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
ssh.connect('14.4.4.44', username='root', key_filename=r'C:\Users\Snarf\.ssh\id_ed25519_snarfnet', timeout=10)
|
||||
|
||||
stdin, stdout, stderr = ssh.exec_command('systemctl status nut-monitor --no-pager')
|
||||
print("STATUS NUT-MONITOR:\n", stdout.read().decode('utf-8', errors='replace'))
|
||||
|
||||
stdin, stdout, stderr = ssh.exec_command('systemctl status nut-server --no-pager')
|
||||
print("STATUS NUT-SERVER:\n", stdout.read().decode('utf-8', errors='replace'))
|
||||
|
||||
ssh.close()
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Reference in New Issue
Block a user