summaryrefslogtreecommitdiffstats
path: root/abs/core/xymon
diff options
context:
space:
mode:
authorBritney Fransen <brfransen@gmail.com>2015-02-19 18:16:16 (GMT)
committerBritney Fransen <brfransen@gmail.com>2015-02-19 18:16:16 (GMT)
commit8de064f6e96f960cdbfe6868d9957a4613f704df (patch)
tree4e73a420991733450d013529c0fee60e0365297a /abs/core/xymon
parent0374b16f1e15ba1819b62bd5a6e0076ac7b243d0 (diff)
parent6fde8cd5e74f0840e01988e743464fe91c0a28f8 (diff)
downloadlinhes_pkgbuild-8de064f6e96f960cdbfe6868d9957a4613f704df.zip
linhes_pkgbuild-8de064f6e96f960cdbfe6868d9957a4613f704df.tar.gz
linhes_pkgbuild-8de064f6e96f960cdbfe6868d9957a4613f704df.tar.bz2
Merge branch 'testing'
Diffstat (limited to 'abs/core/xymon')
-rwxr-xr-xabs/core/xymon/PKGBUILD6
-rw-r--r--abs/core/xymon/gpu-temp.sh76
-rwxr-xr-xabs/core/xymon/hobbit_myth_data.py16
-rw-r--r--abs/core/xymon/xymon-gputemp.sh4
4 files changed, 12 insertions, 90 deletions
diff --git a/abs/core/xymon/PKGBUILD b/abs/core/xymon/PKGBUILD
index e8b73ac..e8908cc 100755
--- a/abs/core/xymon/PKGBUILD
+++ b/abs/core/xymon/PKGBUILD
@@ -1,7 +1,7 @@
pkgbase=xymon
pkgname=('xymonserver' 'xymonclient')
pkgver=4.3.17
-pkgrel=9
+pkgrel=11
pkgdesc="Xymon is a system for monitoring of hosts and networks"
license="GPL"
arch=('i686' 'x86_64')
@@ -169,8 +169,8 @@ md5sums=('d8d119a777e7b7204d1292fb27314312'
'270e13da6cbc9d49079d994edaa71e64'
'22d4c9065fd959efe82f121dcb511305'
'9af2ad60ac4c3cb653754618f603e311'
- 'b8eb10070f2ad6a245d3da15091694ba'
- 'e8f2ac43a1e3b28f5af438d787c86db2'
+ 'a9b7f0a22f29f55b2928160bc44f2c14'
+ '6452d891d88bb46d07bcf7790a523ad0'
'b4e8641e97e6b689dbc634af785e6799'
'e2844513e2c92e8b5084818f3b2a478d'
'98e9242ae346f729b14cb195786571f2'
diff --git a/abs/core/xymon/gpu-temp.sh b/abs/core/xymon/gpu-temp.sh
deleted file mode 100644
index 09f79ca..0000000
--- a/abs/core/xymon/gpu-temp.sh
+++ /dev/null
@@ -1,76 +0,0 @@
-#!/bin/bash
-
-
-
-gpu_temp=0
-gpu_color="clear"
-
-if ! test -x /usr/bin/nvidia-smi ; then
-
- $XYMON $XYMSRV "status $MACHINE.gputemp $gpu_color `date`
- GPUTEMP:$gpu_temp
- Couldn't find nvidia-smi
- "
- exit 0
-fi
-
-# Use NVidia SMI to determine the model
-gpu_model=`nvidia-smi -L`
-if test -z "$gpu_model" ; then
- $XYMON $XYMSRV "status $MACHINE.gputemp $gpu_color `date`
- GPUTEMP:$gpu_temp
- Couldn't find nvidia card
- "
- exit 0
-fi
-
-# Determine GPU maximum temperature based on GPU model
-if test $(echo $gpu_model | grep -c -i 'GeForce 210') -eq 0 ; then
- # GT 210 maximum GPU temperature is 105 C
- max_temp=105
-elif test $(echo $gpu_model | grep -c -i 'GeForce 220') -eq 0 ; then
- # GT 220 maximum GPU temperature is 105 C
- max_temp=105
-elif test $(echo $gpu_model | grep -c -i 'GeForce 240') -eq 0 ; then
- # GT 240 maximum GPU temperature is 105 C
- max_temp=105
-elif test $(echo $gpu_model | grep -c -i 'GeForce 430') -eq 0 ; then
- # GT 430 maximum GPU temperature is 98 C
- max_temp=98
-elif test $(echo $gpu_model | grep -c -i 'GeForce GTS 450') -eq 0 ; then
- # GTS 450 maximum GPU temperature is 100 C
- max_temp=100
-elif test $(echo $gpu_model | grep -c -i 'GeForce GT 520') -eq 0 ; then
- # GT 520 maximum GPU temperature is 102 C
- max_temp=102
-else
- # Assume 100 is the maximum
- max_temp=100
-fi
-crit_temp=`expr $max_temp - 5`
-warn_temp=`expr $crit_temp - 10`
-
-if test -x /usr/bin/nvidia-smi ; then
- temp=`nvidia-smi -q -g 0 -d TEMPERATURE | grep -Ei 'Gpu[[:space:]]+:[[:space:]]+[[:digit:]]+ C'`
- gpu_temp=`echo $temp | sed -e 's/[^0-9]*//g'`
- #echo "GPUTEMP:$gpu_temp" > /tmp/gputemp.txt
- if test -n "$gpu_temp" ; then
- # Have some type of number
- if test $gpu_temp -lt $warn_temp ; then
- gpu_color=green
- elif test $gpu_temp -lt $crit_temp ; then
- gpu_color=yellow
- else
- gpu_color=red
- fi
- #echo gputemp $gpu_temp $gpu_color
- #echo $XYMON $XYMSRV "status $MACHINE.gputemp $gpu_color `date`
- #`cat /tmp/gputemp.txt`
- #"
- $XYMON $XYMSRV "status $MACHINE.gputemp $gpu_color `date`
- GPUTEMP:$gpu_temp
- "
- fi
-fi
-
-exit 0 \ No newline at end of file
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 :
diff --git a/abs/core/xymon/xymon-gputemp.sh b/abs/core/xymon/xymon-gputemp.sh
index cebea41..f8af649 100644
--- a/abs/core/xymon/xymon-gputemp.sh
+++ b/abs/core/xymon/xymon-gputemp.sh
@@ -55,7 +55,7 @@ crit_temp=`expr $max_temp - 5`
warn_temp=`expr $crit_temp - 10`
if test -x /usr/bin/nvidia-smi ; then
- temp=`nvidia-smi -q -g 0 -d TEMPERATURE | grep -Ei 'Gpu[[:space:]]+:[[:space:]]+[[:digit:]]+ C'`
+ temp=`nvidia-smi -q -g 0 -d TEMPERATURE | grep -Ei 'GPU Current Temp[[:space:]]+:[[:space:]]+[[:digit:]]+ C'`
gpu_temp=`echo $temp | sed -e 's/[^0-9]*//g'`
#echo "GPUTEMP:$gpu_temp" > /tmp/gputemp.txt
if test -n "$gpu_temp" ; then
@@ -80,4 +80,4 @@ if test -x /usr/bin/nvidia-smi ; then
fi
fi
-exit 0 \ No newline at end of file
+exit 0