Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
server-monitor
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Recolic
server-monitor
Commits
901c09d4
There was an error fetching the commit references. Please try again later.
Verified
Commit
901c09d4
authored
6 years ago
by
Recolic Keghart
Browse files
Options
Downloads
Patches
Plain Diff
bug fix
parent
10e40142
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
datafile.py.gen.d.py
+5
-4
5 additions, 4 deletions
datafile.py.gen.d.py
with
5 additions
and
4 deletions
datafile.py.gen.d.py
+
5
−
4
View file @
901c09d4
...
...
@@ -6,7 +6,7 @@ import datetime
import
subprocess
# cmd in testcase is tag.
events
=
[]
# [
(
tag, UTC_time_string, information, month,day,year
)
]
events
=
[]
# [
[
tag, UTC_time_string, information, month,day,year
]
]
curr_status
=
{}
# tag -> returncode
def
on_problem_fixed
(
tag
,
desc
):
...
...
@@ -20,10 +20,11 @@ def on_problem_fixed(tag, desc):
def
on_broken
(
tag
,
desc
):
# ...
global
events
curr_time
=
datetime
.
datetime
.
utcnow
()
msg
=
desc
+
'
service went down.
'
new_event
=
(
tag
,
curr_time
.
strftime
(
"
%a %d %b %Y %H:%M:%S %p UTC
"
),
msg
,
curr_time
.
strftime
(
"
%b
"
),
curr_time
.
strftime
(
"
%d
"
),
curr_time
.
strftime
(
"
%Y
"
)
)
events
=
new_event
+
events
new_event
=
[
tag
,
curr_time
.
strftime
(
"
%a %d %b %Y %H:%M:%S %p UTC
"
),
msg
,
curr_time
.
strftime
(
"
%b
"
),
curr_time
.
strftime
(
"
%d
"
),
curr_time
.
strftime
(
"
%Y
"
)
]
events
.
append
(
new_event
)
def
save_status
():
#
...
...
@@ -38,7 +39,7 @@ def save_status():
elements
=
[]
for
event
in
events
:
elements
.
append
(
'
(
"
{}
"
,
"
{}
"
,
"
{}
"
,
"
{}
"
,
"
{}
"
,
"
{}
"
)
'
.
format
(
event
[
0
],
event
[
1
],
event
[
2
],
event
[
3
],
event
[
4
],
event
[
5
]))
elements
.
append
(
'
[
"
{}
"
,
"
{}
"
,
"
{}
"
,
"
{}
"
,
"
{}
"
,
"
{}
"
]
'
.
format
(
event
[
0
],
event
[
1
],
event
[
2
],
event
[
3
],
event
[
4
],
event
[
5
]))
saved_events_str
=
'
saved_events = [
'
+
'
,
'
.
join
(
elements
)
+
'
]
'
file_content
+=
saved_events_str
+
'
\n
'
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment