diff options
author | makefu <github@syntax-fehler.de> | 2012-10-05 06:46:27 +0200 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2012-10-05 06:46:27 +0200 |
commit | 6c89839b7fc344608e61c8916ac9d9925fa98d14 (patch) | |
tree | e316b8121f4880491659dc3cb8851de7762e58a9 /Monitoring/plugins/check_speed | |
parent | 957e2d7469b0e3d88e06b6a15e91478efc63cd62 (diff) |
Monitoring/\* --> nagios/
Diffstat (limited to 'Monitoring/plugins/check_speed')
-rwxr-xr-x | Monitoring/plugins/check_speed | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/Monitoring/plugins/check_speed b/Monitoring/plugins/check_speed deleted file mode 100755 index 14a5b612..00000000 --- a/Monitoring/plugins/check_speed +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -#TODO check_speed is nearly the same as check_speeder, consolidate both scripts, probably by giving HIGH:LOW as params -import sys -import urllib - -if len(sys.argv) < 2 or '-h' in sys.argv: - print ("?? usage: %s URL [low-mhashes] ..." % sys.argv[0]) - print ("?? Server reply should look like this: '2011-07-11T09:00 400.0'") - exit(3) - -URL=sys.argv[1] -thresholds=[ float(i) for i in sys.argv[2:]] - -ecode=0 -try: - ret = urllib.urlopen(URL).read().split() - date = ret[0] - speeds = [float(i) for i in ret[1:]] - print ("** %s : %s Mhashes" % (date,' '.join([str(i) for i in speeds]))) - if len(speeds) != len(thresholds): - raise Exception("!! Number of speeds != number of given thresholds") - for i,speed in enumerate(speeds): - if speed < thresholds[i]: - print ("!! %.2f Mhash < %.2f Mhash ! (field %d)" %(speed,thresholds[i],i)) - ecode=2 -except Exception,e: - print("!! Something aweful happened: "+str(e)) - exit (1) -#TODO return WARNING if date is too old -if not ecode: - print ("** Everything is fine!") - -exit(ecode) |