message
This commit is contained in:
Executable
+22
@@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
up=`/usr/bin/fping -c1 -t300 $1 &> /dev/null ; echo $?`
|
||||||
|
|
||||||
|
if [ $up = 0 ]; then
|
||||||
|
|
||||||
|
set -o errexit
|
||||||
|
set -o nounset
|
||||||
|
|
||||||
|
ADDRESS=$1
|
||||||
|
PORT=$2
|
||||||
|
|
||||||
|
stats_raw=`echo '{"command":"stats"}' | nc $ADDRESS $PORT | tr -d '\0\n'`
|
||||||
|
stats_raw=$(sed 's/}{/\},{/' <<< "$stats_raw")
|
||||||
|
|
||||||
|
STATS=$(jq '.STATS' <<< "$stats_raw")
|
||||||
|
|
||||||
|
#fan_num=$(jq -r '.[1].fan_num' <<< "$STATS")
|
||||||
|
|
||||||
|
echo $STATS
|
||||||
|
|
||||||
|
fi
|
||||||
@@ -1 +1,5 @@
|
|||||||
# zabbix
|
# zabbix
|
||||||
|
|
||||||
|
#Antminer scripts (Antminer S9, L3 ...)
|
||||||
|
AntMinerGetAllstats - Feech asic JSON information
|
||||||
|
rebootasic - Reboot asic wihtout ssh
|
||||||
|
|||||||
Executable
+17
@@ -0,0 +1,17 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import httplib2
|
||||||
|
import sys
|
||||||
|
|
||||||
|
URL = "http://"+sys.argv[1]+"/cgi-bin/reboot.cgi"
|
||||||
|
USER = "root"
|
||||||
|
PASS = "root"
|
||||||
|
|
||||||
|
h = httplib2.Http(cache=None, timeout=0.1)
|
||||||
|
h.add_credentials(USER, PASS)
|
||||||
|
try:
|
||||||
|
resp = h.request(URL, "GET", headers={'cache-control':'no-cache'})
|
||||||
|
resp
|
||||||
|
print"OK"
|
||||||
|
except:
|
||||||
|
print"Asic not avalible"
|
||||||
Reference in New Issue
Block a user