diff options
Diffstat (limited to 'abs/core/LinHES-system/myth_status.py')
-rw-r--r-- | abs/core/LinHES-system/myth_status.py | 10 |
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" |