Commit 8a8842e1 authored by Jonathan Michalon's avatar Jonathan Michalon
Browse files

Support commandline-passed config file in picomon_watchdog

parent 9894b6af
import subprocess
import config
import sys
import os
import importlib
from picomon import config
from picomon import mails
retcode =["python3", ""])
# launch picomon
retcode =["python3", ""] + sys.argv[1:])
# load config file
# (unprotected, will trigger exceptions if problems but real picomon beforehand)
configfile = ""
if "-c" in sys.argv:
configfile = sys.argv[sys.argv.index("-c")+1]
if "--config" in sys.argv:
configfile = sys.argv[sys.argv.index("--config")+1]
filename = os.path.basename(configfile)
base, ext = os.path.splitext(filename)
# send warning
"Picomon exited with status %s" % retcode)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment