Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
picomon
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
arn
picomon
Commits
8a8842e1
Commit
8a8842e1
authored
Aug 24, 2014
by
Jonathan Michalon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support commandline-passed config file in picomon_watchdog
parent
9894b6af
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
3 deletions
+21
-3
picomon_watchdog.py
picomon_watchdog.py
+21
-3
No files found.
picomon_watchdog.py
View file @
8a8842e1
import
subprocess
import
config
import
sys
import
os
import
importlib
from
picomon
import
config
from
picomon
import
mails
retcode
=
subprocess
.
call
([
"python3"
,
"picomon.py"
])
# launch picomon
retcode
=
subprocess
.
call
([
"python3"
,
"picomon.py"
]
+
sys
.
argv
[
1
:])
# load config file
# (unprotected, will trigger exceptions if problems but real picomon beforehand)
configfile
=
"config.py"
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
]
sys
.
path
.
append
(
os
.
path
.
dirname
(
configfile
))
filename
=
os
.
path
.
basename
(
configfile
)
base
,
ext
=
os
.
path
.
splitext
(
filename
)
importlib
.
import_module
(
base
)
# send warning
mails
.
send_email
(
config
.
emails
.
watchdog_subject
,
"Picomon exited with status %s"
%
retcode
)
mails
.
quit
()
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