You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
393 B
13 lines
393 B
|
7 days ago
|
# -*- coding: utf-8 -*-
|
||
|
|
"""票 09:探活 8080 服务。"""
|
||
|
|
import sys, urllib.request
|
||
|
|
|
||
|
|
if hasattr(sys.stdout, 'reconfigure'):
|
||
|
|
sys.stdout.reconfigure(encoding='utf-8')
|
||
|
|
try:
|
||
|
|
r = urllib.request.urlopen('http://localhost:8080/actuator/health', timeout=5)
|
||
|
|
print('HEALTH', r.status, r.read()[:120].decode('utf-8', 'ignore'))
|
||
|
|
except Exception as e:
|
||
|
|
print('DOWN', e)
|
||
|
|
sys.exit(1)
|