summaryrefslogtreecommitdiffstats
path: root/Monitoring/nagios/plugins/check_temper
diff options
context:
space:
mode:
authoreuer <root@euer.krebsco.de>2012-12-23 00:21:25 +0100
committereuer <root@euer.krebsco.de>2012-12-23 00:21:25 +0100
commit9456cfffea015812acf5dcdd2d074e98ca54e720 (patch)
treee57111b7d1499bb6f1ef49937f5f62de158ae5db /Monitoring/nagios/plugins/check_temper
parent3649aff46c8bace238c3cf22abcfbfe8be9dce8a (diff)
//Monitoring -> //god/Monitoring
Diffstat (limited to 'Monitoring/nagios/plugins/check_temper')
-rwxr-xr-xMonitoring/nagios/plugins/check_temper31
1 files changed, 0 insertions, 31 deletions
diff --git a/Monitoring/nagios/plugins/check_temper b/Monitoring/nagios/plugins/check_temper
deleted file mode 100755
index 95191026..00000000
--- a/Monitoring/nagios/plugins/check_temper
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-import sys
-import urllib
-
-if len(sys.argv) < 2 or '-h' in sys.argv:
- print ("?? usage: %s URL [high-val field 1] [high field 2] ..." % sys.argv[0])
- print ("?? Server reply should look like this: '2011-07-11T09:00 50.0 40.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]
- temps = [float(i) for i in ret[1:]]
- print ("** %s : %s" % (date,' '.join([str(i)+"°C" for i in temps])))
- if len(temps) != len(thresholds):
- raise Exception("Number of temps != number of given thresholds")
- for i,temp in enumerate(temps):
- if temp > thresholds[i]:
- print ("!! %.2f°°C > %.2f°C (field %d)!" %(temp,thresholds[i],i))
- ecode=2
-except Exception,e:
- print("!! Something awful happened: "+str(e))
- exit (1)
-if not ecode:
- print ("** Everything is fine!")
-exit(ecode)