Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
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
Léo-Paul Géneau
slapos
Commits
8098add8
Commit
8098add8
authored
Dec 19, 2013
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stack-monitor: script now provides datetime of last running
parent
5f052cce
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
stack/monitor/monitor.py.in
stack/monitor/monitor.py.in
+7
-4
No files found.
stack/monitor/monitor.py.in
View file @
8098add8
#!/usr/bin/python
import
datetime
import
json
import
os
import
subprocess
...
...
@@ -86,12 +87,14 @@ def runScripts(directory):
def
writeFiles
(
monitors
):
open
(
monitoring_file_json
,
"w+"
).
write
(
json
.
dumps
(
monitors
))
if
len
(
monitors
)
==
0
:
open
(
monitoring_file_bool
,
"w+"
).
write
(
"SUCCESS : everything is ok"
)
message
=
"SUCCESS : everything is ok"
else
:
open
(
monitoring_file_bool
,
"w+"
).
write
(
"FAILURE : something went wrong"
)
message
=
"FAILURE : something went wrong"
date
=
datetime
.
datetime
.
now
().
ctime
()
monitors
[
'datetime'
]
=
date
open
(
monitoring_file_bool
,
"w+"
).
write
(
date
+
","
+
message
)
open
(
monitoring_file_json
,
"w+"
).
write
(
json
.
dumps
(
monitors
))
if
__name__
==
"__main__"
:
parser
=
OptionParser
(
option_list
=
option_list
)
...
...
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