Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.toolbox
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xiaowu Zhang
slapos.toolbox
Commits
8ab1ea86
Commit
8ab1ea86
authored
Dec 03, 2012
by
Marco Mariani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added slapmonitor-xml function + entry point
parent
ee4f5b89
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
setup.py
setup.py
+1
-0
slapos/monitor.py
slapos/monitor.py
+20
-0
No files found.
setup.py
View file @
8ab1ea86
...
@@ -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'
,
...
...
slapos/monitor.py
View file @
8ab1ea86
...
@@ -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
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment