ich ein Python-Scripte haben, die für die Prozesse überprüft Import subprocessWie schreibt check_mk manuelle Kontrollen
s = subprocess.check_output('tasklist', shell=True)
if "cmd.exe" in s:
if "java.exe" not in str(s):
print "selenium server is not up"
if "FreeSSHDService.exe" not in str(s):
print "SSH is not up"
else:
print "Everything is awesome"
ich einen Scheck auf check_mk Dashboard hinzufügen möchten, was sind die Schritte, diese Prüfung zu addieren und wo ich muss dieses Skript aufstellen.
import subprocess
s = subprocess.check_output('tasklist', shell=True)
if "cmd.exe" in s:
if "java.exe" not in str(s):
return 2, "selenium server is not up")
if "FreeSSHDService.exe" not in str(s):
return 2, "SSH is not up"
else:
return 0, "Everything is awesome"