summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormakefu <makefu@syntax-fehler.de>2011-06-30 23:33:03 +0200
committermakefu <makefu@syntax-fehler.de>2011-06-30 23:33:03 +0200
commit8a19571735f245380ee3cf4d4023a95fa0cdc736 (patch)
treeedc0521c4d05fd023859700d7c80339b6498d0b4
parent5347a59c010413403eabe9ee584150e96f66623e (diff)
parentf35d129de5003cb46c81a8691ed94285ce467606 (diff)
Merge branch 'master' of github.com:krebscode/painload
Conflicts: mining/Makefile: now installs tmux and configures
-rw-r--r--Monitoring/conf/shack_guests.cfg13
-rwxr-xr-xMonitoring/plugins/check_btcguild_miner27
-rw-r--r--btc/mining/Makefile6
-rwxr-xr-xcensus/arping_users.py6
-rw-r--r--census/mac_names.lst6
-rw-r--r--evan/Makefile1
-rwxr-xr-xevan/evan6
-rwxr-xr-xevan/evan-startup1
-rw-r--r--evan/satz-liste1
9 files changed, 57 insertions, 10 deletions
diff --git a/Monitoring/conf/shack_guests.cfg b/Monitoring/conf/shack_guests.cfg
index 45617461..79796541 100644
--- a/Monitoring/conf/shack_guests.cfg
+++ b/Monitoring/conf/shack_guests.cfg
@@ -26,6 +26,7 @@ define host{
hostgroups bitcoin-miner
}
+#Chinaman
define host{
use generic-host
host_name chinaman
@@ -36,6 +37,18 @@ define host{
hostgroups bitcoin-miner,tinc-nodes,ssh-servers
contact_groups krebsminers
}
+define service {
+ host_name chinaman
+ service_description BTCGUILD hash rate checker
+ use generic-service
+ check_command check_btcguild_miner!4bf1543d2eca8648277bdc66c326eea9!txgen_chinaman!600
+ contact_groups krebsminers
+ }
+
+define command {
+ command_name check_btcguild_miner
+ command_line $USER1$/check_btcguild_miner $ARG1$ $ARG2$ $ARG3$
+ }
define host{
use generic-host
diff --git a/Monitoring/plugins/check_btcguild_miner b/Monitoring/plugins/check_btcguild_miner
new file mode 100755
index 00000000..aacdefc9
--- /dev/null
+++ b/Monitoring/plugins/check_btcguild_miner
@@ -0,0 +1,27 @@
+#!/usr/bin/python2
+import json,urllib,datetime,sys
+if len(sys.argv) != 4 :
+ print "** Usage: %s APIKEY WORKER_NAME LOW_WORKER_SPEED" % sys.argv[0]
+ print "** aka YOU ARE MADE OF STUPID"
+ exit (3)
+
+API_KEY=sys.argv[1]
+WORKER_NAME=sys.argv[2]
+LOW_WORKER_SPEED=float(sys.argv[3])
+url="http://www.btcguild.com/api.php?api_key=%s" % API_KEY
+try:
+ result = json.load(urllib.urlopen(url))
+except e:
+ print "?? cannot parse json or connect to server"
+ exit (1)
+
+for k,v in result["workers"].iteritems():
+ if v["worker_name"] == WORKER_NAME:
+ curr = v["hash_rate"]
+ if curr < LOW_WORKER_SPEED:
+ print "!! %f is below expected %f" (curr,LOW_WORKER_SPEED)
+ exit (2)
+ else:
+ print "++ everything fine, current speed is %f" % curr
+ exit(0)
+
diff --git a/btc/mining/Makefile b/btc/mining/Makefile
index 7f1e4a79..b867d469 100644
--- a/btc/mining/Makefile
+++ b/btc/mining/Makefile
@@ -1,12 +1,12 @@
-.PHONY: all format install
+.PHONY: all format install configure
select-target:
@echo "You are made of stupid!"
echo "look here"
@cat Makefile
format:
cat README
-install:
- apt-get install --yes lm-sensors tmux
+install: configure
+ apt-get install --yes lm-sensors tmux
echo '#!/bin/bash' > /usr/bin/ati_license
echo '#!/bin/sh' > /etc/init.d/live-boot
echo 'wall "going down"' >> /etc/init.d/live-boot
diff --git a/census/arping_users.py b/census/arping_users.py
index c576e4f3..008fe337 100755
--- a/census/arping_users.py
+++ b/census/arping_users.py
@@ -21,7 +21,7 @@ def load_names(MAC_NAMES):
names = {}
f = open(MAC_NAMES)
for l in f:
- mac,name = l.split()
+ mac,name = l.split(' ',1)
names[mac] = name.replace('\n','')
f.close()
return names
@@ -29,7 +29,7 @@ def load_names(MAC_NAMES):
def arping_helper(dic):
return arpingy(**dic)
-for first in range(4):
+for first in range(1,3):
for second in range(255):
data.append({'iprange':'10.42.'+str(first)+'.'+str(second),'iface':DEV})
@@ -50,5 +50,3 @@ for p in ret:
print p[0] + " => " + p[1]
if p[1] in names:
print names[p[1]]+ " is online"
-
-
diff --git a/census/mac_names.lst b/census/mac_names.lst
index dcd3c2b0..ae58b539 100644
--- a/census/mac_names.lst
+++ b/census/mac_names.lst
@@ -1 +1,7 @@
00:40:63:c8:b5:a0 krebs
+00:23:54:29:1d:3e hadez
+00:26:c7:bd:a7:1a Martin
+04:1e:64:05:39:28 Stephan
+5c:59:48:22:2d:d2 Phil
+00:21:00:fb:5c:b6 Kah Hah
+00:1e:64:27:3b:72 Felix
diff --git a/evan/Makefile b/evan/Makefile
index 366e86ee..f87e8505 100644
--- a/evan/Makefile
+++ b/evan/Makefile
@@ -3,6 +3,7 @@ INSTALL_DIR = /root/bin
infect:
mkdir -p ${INSTALL_DIR}
cp evan ${INSTALL_DIR}
+ cp satz-liste ${INSTALL_DIR}
cp evan-startup /etc/init.d/evan
update-rc.d evan start
diff --git a/evan/evan b/evan/evan
index 83443fe2..608ac6b8 100755
--- a/evan/evan
+++ b/evan/evan
@@ -1,11 +1,11 @@
#!/bin/bash
-SATZ_LISTE=/root/evan/satz-liste
+SATZ_LISTE=/krebs/evan/satz-liste
p="${noise_pitch-10}"
v="${noise_lang-de}"
k="${noise_capital-0}"
-a="${noise_amplitude-100}"
+a="${noise_amplitude-600}"
g="${noise_gap-1}"
-RND_DELAY=10000
+RND_DELAY=3600
#set -x
function helpme ()
{
diff --git a/evan/evan-startup b/evan/evan-startup
index a3370bd1..8a7f8daa 100755
--- a/evan/evan-startup
+++ b/evan/evan-startup
@@ -34,6 +34,7 @@ start() {
stop() {
[ ! -e $PIDFILE ] && echo "$PIDFILE does not exist" && return
kill `cat $PIDFILE`
+ #killall evan
rm $PIDFILE
}
diff --git a/evan/satz-liste b/evan/satz-liste
index 3c28f38f..7586ea3b 100644
--- a/evan/satz-liste
+++ b/evan/satz-liste
@@ -7,3 +7,4 @@ der große bruder sieht es gerne wenn die genossen die vereinsräume in stand ha
henry der staubsauger saugt für dich
muelltrennung bringt gutes karma
saubere mitglieder sind glückliche mitglieder
+fnord