summaryrefslogtreecommitdiffstats
path: root/abs/core/xymon/hobbit_myth_data.py
diff options
context:
space:
mode:
authorBritney Fransen <brfransen@gmail.com>2015-02-04 22:27:30 (GMT)
committerBritney Fransen <brfransen@gmail.com>2015-02-04 22:27:30 (GMT)
commit0d278ac3f327671f424b6b7c463e7734f9dee9fe (patch)
tree6e10eef234b8fda0fbf9c7a8b5242844611c0f5c /abs/core/xymon/hobbit_myth_data.py
parentf398554642cf0eea2331762687a4e85c916909af (diff)
downloadlinhes_pkgbuild-0d278ac3f327671f424b6b7c463e7734f9dee9fe.zip
linhes_pkgbuild-0d278ac3f327671f424b6b7c463e7734f9dee9fe.tar.gz
linhes_pkgbuild-0d278ac3f327671f424b6b7c463e7734f9dee9fe.tar.bz2
xymon: hobbit_myth_data.py: change myth_mtc log file and finish text
Diffstat (limited to 'abs/core/xymon/hobbit_myth_data.py')
-rwxr-xr-xabs/core/xymon/hobbit_myth_data.py16
1 files changed, 7 insertions, 9 deletions
diff --git a/abs/core/xymon/hobbit_myth_data.py b/abs/core/xymon/hobbit_myth_data.py
index ac56903..ec16818 100755
--- a/abs/core/xymon/hobbit_myth_data.py
+++ b/abs/core/xymon/hobbit_myth_data.py
@@ -66,11 +66,9 @@ def check_mtc(mtc_file):
print "couldn't open %s file" %mtc_file
return False
else:
- mtc = infile.readlines()
+ mtc = infile.read()
infile.close()
- for i in mtc:
- line=i
- if line.split()[0] == "Finished":
+ if "Finished Maintenance" in mtc:
return True
else:
return False
@@ -99,7 +97,7 @@ now = datetime.datetime.now()
#date = "%s-%s-%s" %(now.year, now.month, now.day)
date = (now.strftime('%Y-%m-%d'))
#2013-12-03
-mtc_file = "/var/log/%s/myth_mtc.log" %date
+mtc_file = "/var/log/%s/%s_myth_mtc.log" %(date,os.uname()[1])
mtc=check_mtc(mtc_file)
num_days=find_data_left()
@@ -109,14 +107,14 @@ current_color=0
if mtc:
current_color = set_color_code(current_color,0)
- msg="\n Maintenance script was successful \n Log file: %s\n " %mtc_file
+ msg="\n Maintenance completed successfully. \n Log file: %s\n " %mtc_file
else:
current_color = set_color_code(current_color,2)
msg='''
- ** Maintenance script did not run. **
- BACKUP FILE WAS NOT CREATED
+ ** Maintenance did NOT complete sucessfully. **
- The system may have been busy
+ The system may have been busy.
+ See the log for more information.
Log file: %s \n''' %mtc_file
if num_days == 1 :