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
34ff03cb
There was an error fetching the commit references. Please try again later.
Verified
Commit
34ff03cb
authored
5 years ago
by
Recolic Keghart
Browse files
Options
Downloads
Patches
Plain Diff
add a new status: service closed
parent
d0bc34c3
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
datafile.py.gen.d.py
+11
-1
11 additions, 1 deletion
datafile.py.gen.d.py
do.bash
+10
-0
10 additions, 0 deletions
do.bash
status.html.gen.py
+1
-1
1 addition, 1 deletion
status.html.gen.py
with
22 additions
and
2 deletions
datafile.py.gen.d.py
+
11
−
1
View file @
34ff03cb
...
...
@@ -9,6 +9,8 @@ import subprocess
events
=
[]
# [ [tag, UTC_time_string, information, month,day,year] ]
curr_status
=
{}
# tag -> returncode
RETURN_CODE_SERVICE_CLOSE
=
91
def
on_problem_fixed
(
tag
,
desc
):
# ...
fixed_prefix
=
'
<strong>Resolved</strong> -
'
...
...
@@ -32,7 +34,15 @@ def save_status():
elements
=
[]
for
tag
,
desc
in
tests
:
color
=
'
green
'
if
curr_status
[
tag
]
==
0
else
'
red
'
if
curr_status
[
tag
]
==
0
:
# OK
color
=
'
green
'
elif
curr_status
[
tag
]
==
RETURN_CODE_SERVICE_CLOSE
:
# Service closed as expected
color
=
'
blue
'
else
:
# Service down
color
=
'
red
'
elements
.
append
(
'
(
"
{}
"
,
"
{}
"
)
'
.
format
(
desc
,
color
))
current_status_str
=
'
current_status = [
'
+
'
,
'
.
join
(
elements
)
+
'
]
'
file_content
+=
current_status_str
+
'
\n
'
...
...
This diff is collapsed.
Click to expand it.
do.bash
+
10
−
0
View file @
34ff03cb
...
...
@@ -4,6 +4,8 @@
[[
$(
id
-u
)
=
0
]]
&&
ping_fld
=
"-f"
RETURN_CODE_SERVICE_CLOSE
=
91
function
confirm_alive
()
{
local
host
=
"
$1
"
timeout
4s ping
"
$host
"
-c
1
...
...
@@ -36,6 +38,7 @@ function do_test () {
echo
"Testing >>
$1
"
>
/dev/fd/2
case
"
$1
"
in
rproxy
)
return
$RETURN_CODE_SERVICE_CLOSE
confirm_alive proxy.recolic.net
&&
test_tcp proxy.recolic.net 22 |
grep
-a
SSH
||
return
$?
;;
...
...
@@ -53,12 +56,15 @@ function do_test () {
test_tcp base.hk1.recolic.net 30999
||
return
$?
;;
ss-us1
)
return
$RETURN_CODE_SERVICE_CLOSE
test_ss base.us1.recolic.net
||
return
$?
;;
ss-us5
)
return
$RETURN_CODE_SERVICE_CLOSE
test_ss base.us5.recolic.net
||
return
$?
;;
ss-us6
)
return
$RETURN_CODE_SERVICE_CLOSE
test_ss base.us6.recolic.net
||
return
$?
;;
ovpn-tw
)
...
...
@@ -111,15 +117,18 @@ function do_test () {
curl
-s
http://git.recolic.net/
-L
|
grep
'users/sign_in'
||
return
$?
;;
zhixiang
)
return
$RETURN_CODE_SERVICE_CLOSE
grep
'api.anjie-elec.cn'
/etc/hosts
||
echo
'123.206.117.183 api.anjie-elec.cn'
>>
/etc/hosts
[[
$?
!=
0
]]
&&
echo
'Failed to edit hosts file! Unable to perform this test.'
>
/dev/fd/2
&&
return
0
curl
-k
-X
POST
-s
'https://api.anjie-elec.cn/api/usewater/Add?accessToken=FUCKYOU'
|
grep
'104871845A503324'
||
return
$?
;;
mc
)
return
$RETURN_CODE_SERVICE_CLOSE
confirm_alive mc.recolic.net
&&
test_tcp mc.recolic.net 25565
||
return
$?
;;
push-httpdb-agent
)
return
$RETURN_CODE_SERVICE_CLOSE
local
r
=
"
$RANDOM
"
confirm_alive git.recolic.net
&&
curl
-s
"https://git.recolic.net/_r_testing/set/_status_test|
$r
"
&&
...
...
@@ -146,6 +155,7 @@ function do_test () {
curl
-s
'https://recolic.net/go/index.php'
--data
'target=https%3A%2F%2Fwww.google.com&name=google&super='
|
grep
Success
||
return
$?
;;
rocket
)
return
$RETURN_CODE_SERVICE_CLOSE
confirm_alive rocket.recolic.net
&&
curl
-s
https://rocket.recolic.net:444/api/info |
grep
'success":true'
||
return
$?
;;
...
...
This diff is collapsed.
Click to expand it.
status.html.gen.py
+
1
−
1
View file @
34ff03cb
...
...
@@ -73,7 +73,7 @@ def _color2stat(color):
if
color
==
'
green
'
:
return
'
Operational
'
if
color
==
'
blue
'
:
return
'
Maintenance
'
return
'
Service closed
'
if
color
==
'
red
'
:
return
'
Major Outage
'
if
color
==
'
orange
'
:
...
...
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