Check-host.net - API - список полезных команд
Материал из Wiki - Iphoster - the best ever hosting and support. 2005 - 2026
Check-host.net - API - список полезных команд
https://check-host.net/about/api
Получить список всех нод:
curl -s -H "Accept: application/json" https://check-host.net/nodes/hosts | python3 -c "
import sys, json
data = json.load(sys.stdin)['nodes']
for node, info in data.items():
loc = info['location']
print(f'{node} — {loc[1]}, {loc[2]}')
" | sort
Проверка подключений TCP PORT через RU ноды:
read -p "Введите IP:порт (например 91.108.237.61:22): " HOST
NODES="ru1.node.check-host.net&node=ru2.node.check-host.net&node=ru3.node.check-host.net"
REQ_ID=$(curl -s -H "Accept: application/json" \
"https://check-host.net/check-tcp?host=$HOST&node=$NODES" \
| python3 -c "import sys,json;print(json.load(sys.stdin)['request_id'])")
echo "Request ID: $REQ_ID"
sleep 4
curl -s -H "Accept: application/json" \
"https://check-host.net/check-result/$REQ_ID" | python3 -c "
import sys, json
data = json.load(sys.stdin)
print(f'{\"Node\":<30} {\"Address\":<22} {\"Time\":<10} Status')
print('-' * 75)
for node, results in data.items():
if results is None:
print(f'{node:<30} {\"-\":<22} {\"-\":<10} PENDING')
elif isinstance(results, list) and len(results) > 0:
r = results[0]
if 'time' in r:
t = f\"{r['time']:.3f}s\"
addr = r['address']
print(f'{node:<30} {addr:<22} {t:<10} OK')
else:
print(f'{node:<30} {\"-\":<22} {\"-\":<10} NOT OK ({r.get(\"error\", \"unknown\")})')
"
| Язык | Библиотека | Ссылка |
|---|---|---|
| Rust | tbdsux/check-host | https://github.com/tbdsux/check-host |
| Go | d1manpro/checkhost | https://github.com/d1manpro/checkhost |
| Ruby | und3f/checkhost-client-ruby | https://github.com/und3f/checkhost-client-ruby |
| Python | diasnull/check-host | https://github.com/diasnull/check-host |
| PHP | ILYAGVC/CheckHostPHP | https://github.com/ILYAGVC/CheckHostPHP |
| PHP | alirezax5/checkHost | https://github.com/alirezax5/checkHost |
| Java | FlorianMichael/CheckHost4J | https://github.com/FlorianMichael/CheckHost4J |
| PowerShell | Lifailon/Check-Host | https://github.com/Lifailon/Check-Host |
