Commit 8ab1ea86 authored by Marco Mariani's avatar Marco Mariani

added slapmonitor-xml function + entry point

parent ee4f5b89
...@@ -65,6 +65,7 @@ setup(name=name, ...@@ -65,6 +65,7 @@ setup(name=name,
'shacache = slapos.shacache:main', 'shacache = slapos.shacache:main',
'slapbuilder = slapos.builder:main', 'slapbuilder = slapos.builder:main',
'slapmonitor = slapos.monitor:run_slapmonitor', 'slapmonitor = slapos.monitor:run_slapmonitor',
'slapmonitor-xml = slapos.monitor:run_slapmonitor_xml',
'slapreport = slapos.monitor:run_slapreport', 'slapreport = slapos.monitor:run_slapreport',
'slaprunner = slapos.runner:run', 'slaprunner = slapos.runner:run',
'killpidfromfile = slapos.systool:killpidfromfile', 'killpidfromfile = slapos.systool:killpidfromfile',
......
...@@ -334,8 +334,28 @@ def run_slapmonitor(): ...@@ -334,8 +334,28 @@ def run_slapmonitor():
log_file = True log_file = True
proc = psutil.Process(read_pid(args[0])) proc = psutil.Process(read_pid(args[0]))
# XXX FIXME: THE PID IS ONLY READ ONCE.
# process death and pid reuse are not detected.
SlapMonitor(proc, opts.update_time, args[1]) SlapMonitor(proc, opts.update_time, args[1])
def run_slapmonitor_xml():
#This function require the database path and XML path
parser = parse_opt()
opts, args = parser.parse_args()
if len(args) != 2:
parser.error("Incorrect number of arguments, 2 required but "+str(len(args))+" detected" )
if opts.path_log_file:
logging.basicConfig(filename=opts.path_log_file,level=logging.DEBUG)
global log_file
log_file = True
get_xml_hand = GenerateXML(ElementTree, args[0], args[1])
get_xml_hand.dump_xml()
def run_slapreport_(): def run_slapreport_():
#This function require the xml_path and database_path #This function require the xml_path and database_path
parser = parse_opt() parser = parse_opt()
......
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