Hi,
habe ein Script gebaut aber sehe dieses nicht in Wato.
Ich habe eine Ausgabe wenn ich es manuell ausführe und auch mittels cmk -d. Leider sehe ich in Wato nichts. Keine Fehlermeldung aber auch keinen Output. Beim Host ist Configured API Integrations and Checkmk agent aktiviert.
Hat jemand einen Tipp?
Hier das Script:
#!/usr/bin/env python3
import paramiko
import sys
import timeHOST = sys.argv[1]
USER = sys.argv[2]
PASSWORD = sys.argv[3]COMMAND = “show radius status\n”
try:
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())ssh.connect( HOST, username=USER, password=PASSWORD, timeout=10, look_for_keys=False, allow_agent=False, ) shell = ssh.invoke_shell() time.sleep(1) # Clear banner / login noise if shell.recv_ready(): shell.recv(65535) shell.send(COMMAND) time.sleep(2) output = "" while shell.recv_ready(): output += shell.recv(65535).decode(errors="ignore") ssh.close() output = output.lower() if "connected" in output: print("OK - RADIUS connected") sys.exit(0) elif "init" in output: print("WARN - RADIUS initializing") sys.exit(1) else: print("CRIT - RADIUS not connected") sys.exit(2)except Exception as e:
print(f"CRIT - SSH error: {e}")
sys.exit(2)