summaryrefslogtreecommitdiffstats
path: root/abs/core/LinHES-system/myth_status.py
diff options
context:
space:
mode:
authorBritney Fransen <brfransen@gmail.com>2013-12-11 16:57:42 (GMT)
committerBritney Fransen <brfransen@gmail.com>2013-12-11 16:57:42 (GMT)
commit78e5c0eb57d6bd88bbf81ddbe9f474a0a896b298 (patch)
tree963b884ab71097b035dc06321e1cc30482a42c91 /abs/core/LinHES-system/myth_status.py
parent8ae3e21c370d8a60b4572f35ea8d1654bc197f9f (diff)
downloadlinhes_pkgbuild-78e5c0eb57d6bd88bbf81ddbe9f474a0a896b298.zip
linhes_pkgbuild-78e5c0eb57d6bd88bbf81ddbe9f474a0a896b298.tar.gz
linhes_pkgbuild-78e5c0eb57d6bd88bbf81ddbe9f474a0a896b298.tar.bz2
LinHES-system: myth_status.py: add support for color levels. refs #943 #945
remove diskspace.cron as xymon now monitors and notifies disk levels
Diffstat (limited to 'abs/core/LinHES-system/myth_status.py')
-rw-r--r--abs/core/LinHES-system/myth_status.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/abs/core/LinHES-system/myth_status.py b/abs/core/LinHES-system/myth_status.py
index 0f2edfb..df8c84a 100644
--- a/abs/core/LinHES-system/myth_status.py
+++ b/abs/core/LinHES-system/myth_status.py
@@ -5,6 +5,7 @@
from MythTV import MythBE,MythDB,MythLog
import datetime,time,sys,subprocess,re
import os,glob
+from socket import gethostname;
def formatTD(td):
days = td.days
@@ -56,6 +57,7 @@ def print_alerts():
out_line=''
datahost = ''
dataservice = ''
+ datacolor = ''
datadown = ''
try:
#print " myth_staus: reading in %s" %alert_file
@@ -76,14 +78,16 @@ def print_alerts():
datahost = value.strip()
elif data == 'SERVICE':
dataservice = value.strip()
+ elif data == 'COLOR':
+ datacolor = value.strip()
elif data == 'DOWN':
datadown = value.strip()
sec=int(datadown)
td_sec = datetime.timedelta(seconds=sec)
td_sec_formated = formatTD(td_sec)
- out_line =" %s on %s down for %s \n" %(dataservice,
- datahost,
+ out_line =" %s on %s %s for %s \n" %(dataservice,
+ datahost,datacolor.upper(),
td_sec_formated)
out_alert += out_line
@@ -91,7 +95,7 @@ def print_alerts():
print "---------------"
if len(out_alert) > 0:
print out_alert
- print " Please see the system health webpage for more information"
+ print " Go to http://%s and click Health & Maintenance for more information." %gethostname()
else:
print " All systems OK"