diff options
21 files changed, 299 insertions, 185 deletions
diff --git a/abs/core/LinHES-config/PKGBUILD b/abs/core/LinHES-config/PKGBUILD index 42597bc..b373509 100644 --- a/abs/core/LinHES-config/PKGBUILD +++ b/abs/core/LinHES-config/PKGBUILD @@ -1,6 +1,6 @@ pkgname=LinHES-config pkgver=2.3 -pkgrel=51 +pkgrel=54 conflicts=(MythVantage-config MythVantage-config-dev LinHES-config-dev LinHes-config ) pkgdesc="Install and configure your system" depends=('bc' 'libstatgrab' 'mysql-python' 'expect' 'curl' 'dnsutils' 'parted' @@ -132,7 +132,7 @@ md5sums=('f6bca2af75ddb0902f0fa9ff4b6e4fd7' 'fe5e31b833cc6707209e9d656b6eb53c' 'f0988a801216b44c96bf17e24a23e3a9' '23d0e12b7ca1cc6ea6b993c1d7ff20b9' - '952ddc53f1c1ceee2139888219ce1bdf' + 'bce31dc826812d1b32003f77f9945ca9' '892ba04c504b9be04b2573d015382eae' '2596460462cf6c889cf8f95485537b20' 'a63ff9ef5250965aeabc74bfa8e43981') diff --git a/abs/core/LinHES-config/mv_hostype.py b/abs/core/LinHES-config/mv_hostype.py index bdc12f4..1396dfe 100755 --- a/abs/core/LinHES-config/mv_hostype.py +++ b/abs/core/LinHES-config/mv_hostype.py @@ -315,9 +315,7 @@ def hostypeprint(systemconfig): install_list = ["rpcbind", "nfs-utils", "avahi", "libmysqlclient" ] daemon_list = ["mythbackend", "rpcbind", "nfs-common", "netfs", "avahi" ] - daemon_remove_list=('mysql') - daemon_list.remove("lighttpd") - remove_list.append("lighttpd") + daemon_remove_list=["mysql", "lighttpd", "certmaster"] if func_supported: install_list.append('func') diff --git a/abs/core/dcron/dcron.install b/abs/core/dcron/dcron.install index 3e4f126..b3e90da 100644 --- a/abs/core/dcron/dcron.install +++ b/abs/core/dcron/dcron.install @@ -14,4 +14,7 @@ post_upgrade() { } +post_install() { + post_upgrade +} # vim:set ts=2 sw=2 et: diff --git a/abs/core/e16_theme_settings/PKGBUILD b/abs/core/e16_theme_settings/PKGBUILD index 41b36a5..9091efa 100644 --- a/abs/core/e16_theme_settings/PKGBUILD +++ b/abs/core/e16_theme_settings/PKGBUILD @@ -1,6 +1,6 @@ pkgname=e16_theme_settings pkgver=1.0 -pkgrel=4 +pkgrel=7 pkgdesc="Default settings for e16" depends=(enlightenment) source=() diff --git a/abs/core/e16_theme_settings/e16.install b/abs/core/e16_theme_settings/e16.install index 61fed63..9840e93 100644 --- a/abs/core/e16_theme_settings/e16.install +++ b/abs/core/e16_theme_settings/e16.install @@ -26,7 +26,11 @@ pre_upgrade() { # arg 1: the new package version # arg 2: the old package version post_upgrade() { - /bin/true + if [ -e /data/e16_config_dir/cached ] + then + rm -rf /data/e16_config_dir/cached/* + fi + post_install } # arg 1: the old package version diff --git a/abs/core/e16_theme_settings/e16_config_dir/themes/Summer/graphics/startup-overlay.png b/abs/core/e16_theme_settings/e16_config_dir/themes/Summer/graphics/startup-overlay.png Binary files differindex 0037387..480edf0 100644 --- a/abs/core/e16_theme_settings/e16_config_dir/themes/Summer/graphics/startup-overlay.png +++ b/abs/core/e16_theme_settings/e16_config_dir/themes/Summer/graphics/startup-overlay.png diff --git a/abs/core/e16_theme_settings/e16_config_dir/themes/Summer/init.cfg b/abs/core/e16_theme_settings/e16_config_dir/themes/Summer/init.cfg index 4134287..037d1c8 100644 --- a/abs/core/e16_theme_settings/e16_config_dir/themes/Summer/init.cfg +++ b/abs/core/e16_theme_settings/e16_config_dir/themes/Summer/init.cfg @@ -7,7 +7,7 @@ __E_CFG_VERSION 1 BEGIN_BACKGROUND(STARTUP_BACKGROUND) SET_SOLID("0 114 188") //ADD_BACKGROUND_TILED_SCALED_VERTICALLY("artwork/backgrounds/back-startup.png") - ADD_OVERLAY_IMAGE_CENTERED("graphics/startup-overlay.png") + ADD_OVERLAY_IMAGE_ASPECT("graphics/startup-overlay.png") END_BACKGROUND __ICLASS __BGN diff --git a/abs/core/func/PKGBUILD b/abs/core/func/PKGBUILD index d7d4019..1110451 100644 --- a/abs/core/func/PKGBUILD +++ b/abs/core/func/PKGBUILD @@ -1,6 +1,6 @@ pkgname=func pkgver=0.25 -pkgrel=2 +pkgrel=4 pkgdesc="fedora unifed network controller" url="" license="gpl" @@ -8,10 +8,10 @@ depends=(pyopenssl certmaster python_aosd) makedepends=() conflicts=() replaces=() -backup=() +backup=('etc/func/minion.conf') moddir="pkg/usr/lib/python2.6/site-packages/func/minion/modules/" install=func.install -source=($pkgname-$pkgver.tar.gz minion.conf power.py pacman.py failed_func.sh fe_restart.py msg.py msg.cfg) +source=($pkgname-$pkgver.tar.gz minion.conf power.py pacman.py failed_func fe_restart.py msg.py msg.cfg) arch=('i686') build() { @@ -28,7 +28,7 @@ build() { install -m755 -D $startdir/src/msg.py ${startdir}/${moddir}/msg.py install -m755 -D $startdir/src/msg.cfg ${startdir}/pkg/usr/MythVantage/etc/msg.cfg install -m755 -D $startdir/src/fe_restart.py ${startdir}/${moddir}/fe_restart.py - install -m755 -D $startdir/src/failed_func.sh $startdir/pkg/usr/MythVantage/bin/failed_func.sh + install -m755 -D $startdir/src/failed_func $startdir/pkg/usr/MythVantage/bin/failed_func mkdir -p $startdir/pkg/var/log/func cd $startdir/pkg @@ -38,7 +38,7 @@ md5sums=('892252004f122c61bb58bb4607553ffe' '1e2905074203d5c0557f143a6c50c497' '1393088fa64823606e0b1c02296041f4' '65a602524cb85773740840eaa513ce15' - 'aa4d3f4612965ae99d6ba2e40673c3ac' + '5c62fad46fb95a14bc7093b506098e07' 'b02a733b7a74569e57521bc3708724a5' '572bb6737cb03dee7e9d11ed40481bd2' '4f189262b2a686c5ac9485c6e5134045') diff --git a/abs/core/func/failed_func.sh b/abs/core/func/failed_func index b44eb65..943fab9 100644 --- a/abs/core/func/failed_func.sh +++ b/abs/core/func/failed_func @@ -1,10 +1,11 @@ +#!/bin/bash . /etc/profile . /etc/systemconfig -if [ x$SystemType = "xMaster_backend" -o x$SystemType = "xStandAlone" ] -then - exit 0 -fi +#if [ x$SystemType = "xMaster_backend" -o x$SystemType = "xStandAlone" ] +#then +# exit 0 +#fi curl -# http://$dbhost/failed_func_hosts|grep -q `hostname` status=$? if [ $status = 0 ] diff --git a/abs/core/func/func.install b/abs/core/func/func.install index 1fcf6b1..f204214 100644 --- a/abs/core/func/func.install +++ b/abs/core/func/func.install @@ -15,7 +15,7 @@ post_install() { fi if [ ! -e /etc/cron.tenminutes/failed_func ] then - ln -s /usr/MythVantage/bin/failed_func.sh /etc/cron.tenminutes/failed_func + ln -s /usr/MythVantage/bin/failed_func /etc/cron.tenminutes/failed_func fi if [ ! -e /var/log/func ] diff --git a/abs/core/mythinstall/PKGBUILD b/abs/core/mythinstall/PKGBUILD index 92ba4bb..ce0ec36 100644 --- a/abs/core/mythinstall/PKGBUILD +++ b/abs/core/mythinstall/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Jams pkgname=mythinstall pkgver=3 -pkgrel=15 +pkgrel=17 pkgdesc="LinHES installer/systemconfig GUI." arch=i686 depends=() diff --git a/abs/core/supplemental-web/contents/home.shtml b/abs/core/supplemental-web/contents/home.shtml index fe70014..18d66e2 100644 --- a/abs/core/supplemental-web/contents/home.shtml +++ b/abs/core/supplemental-web/contents/home.shtml @@ -4,20 +4,12 @@ </head> <body> -<div id="mainContainer"> -<!-- <div id="header"><p></p></div> - <div id="content"> - <p></p>--> - - <!--#exec cmd="/data/srv/httpd/htdocs/count.py" --> - - -</br> -</br> - <img src="/xymon/gifs/network.png" > - -<div id="footer"><p>Thank you for choosing LinHES</p></div> - + <div id="mainContainer"> + <!--#exec cmd="/data/srv/httpd/htdocs/count.py" --> + </br> + <img src="/xymon/gifs/network.png" > + </br> </br> + <div id="footer"><p>Thank you for choosing LinHES</p></div> </body> </html> diff --git a/abs/core/supplemental-web/contents/process.py b/abs/core/supplemental-web/contents/process.py index 48e56d2..93d16d9 100644 --- a/abs/core/supplemental-web/contents/process.py +++ b/abs/core/supplemental-web/contents/process.py @@ -259,7 +259,7 @@ if __name__ == '__main__': print mainpage % body selection=radio - myhost=hidden + myhost=hidden.lower() if selection == "Restore": mylogfile=go_restore(name,myhost) diff --git a/abs/core/xymon/PKGBUILD b/abs/core/xymon/PKGBUILD index 560bbeb..9c1ef87 100644 --- a/abs/core/xymon/PKGBUILD +++ b/abs/core/xymon/PKGBUILD @@ -1,14 +1,14 @@ pkgbase=xymon pkgname=(xymonserver xymonclient) pkgver=4.3.5 -pkgrel=24 +pkgrel=25 pkgdesc="Hobbit is a system for monitoring servers and networks. " license="GPL" arch=('i686' 'x86_64') url="http://www.xymon.com/" -source=(http://voxel.dl.sourceforge.net/project/xymon/Xymon/4.3.5/xymon-4.3.5.tar.gz hobbitadd.py xymon_ghost_check graph.cfg.diff xymonserver.cfg.diff tasks.d.mv clientlaunch.cfg.patch hobbitstorage.py hbnotes.py hobbit-myth-orphan.sh analysis.cfg hbfunc.py be.png tuner.png tv.png hobbit-mem-myth.sh hobbit_notify.sh alerts.cfg hobbit_myth_data.py logrotate.xymon log_list.sh client-local.cfg.patch) +source=(http://voxel.dl.sourceforge.net/project/xymon/Xymon/4.3.5/xymon-4.3.5.tar.gz hobbitadd.py xymon_ghost_check graph.cfg.diff xymonserver.cfg.diff tasks.d.mv clientlaunch.cfg.patch hobbitstorage.py hbnotes.py hobbit-myth-orphan.sh analysis.cfg hbfunc.py be.png tuner.png tv.png hobbit-mem-myth.sh hobbit_notify.sh alerts.cfg hobbit_myth_data.py logrotate-server.xymon logrotate-client.xymon log_list.sh client-local.cfg.patch led_themes.tar.gz ) depends=(rrdtool fping pcre python graphviz) install=xymon.install @@ -46,6 +46,7 @@ build() { } package_xymonserver(){ + backup=('data/srv/xymon/etc/hosts.cfg') cd $startdir/src/xymon-$pkgver make PKGBUILD=1 INSTALLROOT=$startdir/pkg/xymonserver install cd $startdir/src @@ -67,12 +68,19 @@ package_xymonserver(){ install -m755 $startdir/src/tuner.png $startdir/pkg/xymonserver/data/srv/httpd/htdocs/xymon/gifs/tuner.png install -m755 $startdir/src/be.png $startdir/pkg/xymonserver/data/srv/httpd/htdocs/xymon/gifs/be.png - install -D -m755 $startdir/src/logrotate.xymon $startdir/pkg/xymonserver/etc/logrotate.d/xymon + install -D -m644 $startdir/src/logrotate-server.xymon $startdir/pkg/xymonserver/etc/logrotate.d/xymon-server + #copy in replacment icon set + DOCDIR=$startdir/pkg/xymonserver/data/srv/httpd/htdocs/xymon + cp -rp $DOCDIR/gifs $DOCDIR/gifs.orig + cd $startdir/src/themes + cp -fp Common/* $DOCDIR/gifs/ + cp -fp ModernLED/* $DOCDIR/gifs/ #apply patches to conf file # mkdir -p $startdir/pkg/xymonserver/data/srv/xymon/etc/tasks.d/ # mkdir -p $startdir/pkg/xymonserver/data/srv/xymon/etc/tasks.d/ - cat $startdir/src/tasks.d.mv >> $startdir/pkg/xymonserver/data/srv/xymon/etc/tasks.cfg + install -D -m755 $startdir/src/tasks.d.mv $startdir/pkg/xymonserver/data/srv/xymon/etc/tasks.d/mv.cfg +# cat $startdir/src/tasks.d.mv >> $startdir/pkg/xymonserver/data/srv/xymon/etc/tasks.cfg cd $startdir/pkg/xymonserver/data/srv/xymon/etc patch -p0 < $startdir/src/graph.cfg.diff || return 1 patch -p0 < $startdir/src/xymonserver.cfg.diff || return 1 @@ -86,10 +94,11 @@ package_xymonserver(){ package_xymonclient(){ #create client package as well depends=() + backup=('data/srv/xymon/client/etc/xymonclient.cfg') install=xymon-client.install - install -D -m755 $startdir/src/log_list.sh $startdir/pkg/xymon/client/data/srv/xymon/client/bin/log_list.sh - install -D -m755 $startdir/src/logrotate.xymon $startdir/pkg/xymonclient/etc/logrotate.d/xymon + install -D -m755 $startdir/src/log_list.sh $startdir/pkg/xymonclient/data/srv/xymon/client/bin/log_list.sh + install -D -m644 $startdir/src/logrotate-client.xymon $startdir/pkg/xymonclient/etc/logrotate.d/xymon-client install -D -m755 $startdir/src/hobbit-mem-myth.sh $startdir/pkg/xymonclient/data/srv/xymon/client/ext/hobbit-mem-myth.sh cp -rp /$startdir/pkg/xymonserver/data/srv/xymon/client/ $startdir/pkg/xymonclient/data/srv/xymon/ @@ -109,10 +118,10 @@ md5sums=('31923ec126fe1c264fceb459d2175161' 'cc845b5aedc33dda8e3103b915fe4967' '650b523d879f32c1bad3b4a9e10e7c93' '093648dabb0d1da0fdcc37b327737f43' - '62b73cf181fdc227c95aade509b65c0a' + '84f6b0db44e5142bb59aeabc7ea875af' '6eb6ecdf33454f35b6c2409b863c816f' 'f6921f0413215ae174e81306be80d37f' - 'c08b0f116674b1eb8cd5902c1f497644' + 'be02f5d21373f97224ffa4727ec9718a' 'd210c43fb9ee9ad6cd7648e0c2e0efea' '0c808fa12672289f86b0651545381308' '0469d775db9fdd18ea95dd41937ada82' @@ -120,6 +129,8 @@ md5sums=('31923ec126fe1c264fceb459d2175161' '622f400fd098cbc43c203e3210a6694e' 'd06c4327cc69aeead3fa05f39660f33e' '129353c8ad92e89c691382a98dd5ce77' - 'e6a3ed8b8f6abe357bd1736ff1e63001' + 'f6ff1fb4bacee930007b877424619b30' + 'e06147db25d75cf246886137a4ea164a' '98e9242ae346f729b14cb195786571f2' - '40fa09bdb1ae60f3fe767f1c6a979b65') + '40fa09bdb1ae60f3fe767f1c6a979b65' + 'c7178bbf384bbe86c318b60fef6faf10') diff --git a/abs/core/xymon/hbfunc.py b/abs/core/xymon/hbfunc.py index edd2461..39e1680 100644 --- a/abs/core/xymon/hbfunc.py +++ b/abs/core/xymon/hbfunc.py @@ -2,11 +2,13 @@ #checks that the MBE can connect to the minions # =============================================== -import sys +import sys, subprocess import os import string import time import func.overlord.client as fc +import datetime + BBLINE = '' BBCOLOR="green" DATE = time.strftime("%a %b %d %H:%M:%S %Z %Y", time.localtime(time.time())) @@ -27,6 +29,91 @@ BBDISP="127.0.01" # MACHINE=os.environ['MACHINE'] +failed_func_hosts_file="/data/srv/httpd/htdocs/failed_func_hosts" + +def print_out(msg): + #print msg + pass + +def clear_func_cert(currentclient): + cmd="sudo /usr/bin/certmaster-ca -c " + currentclient + os.system(cmd) + line="clearing out certs via certmaster: %s" %currentclient + print_out(line) + + +def ispresent_failedfunc(host): + host=host.split(",")[0].strip() + ispresent = False + try: + f = open(failed_func_hosts_file, "r") + failed_list = f.readlines() + for line in failed_list: + print_out(host+" "+line) + if host.strip() == line.split(",")[0].strip(): + ispresent = True + break + except: + pass + print_out("host: %s is present %s" %(host,ispresent)) + return ispresent + +def remove_from_failedfunc(host): + count_fail="/tmp/%s.failed" %host + print_out("removing from failed list: %s" %host) + f = open(failed_func_hosts_file,'r') + failed_lines=f.readlines() + f.close + f = open(failed_func_hosts_file,'w') + for line in failed_lines: + if line.startswith(currentclient.strip()): + continue + f.write(line) + f.close() + if os.path.exists(count_fail): + os.remove(count_fail) + +def count_failed(host): + + + now = datetime.datetime.now() + now_str=str(now) + fc=0 + count_fail="/tmp/%s.failed" %host + with open(count_fail, "a") as f: + f.write(now_str+"\n") + + f = open(count_fail, "r") + failed_list = f.readlines() + f.close() + fc=len(failed_list) + print_out("number of failures for %s: %s" %(host,fc)) + return fc + + + +def add_to_failed_host(host): + #check number of times it's failed. If more then three, write func file + cf = count_failed(host.split(",")[0].strip()) + currentclient = host.split(",")[0].strip() + if not ispresent_failedfunc(host) and cf > 3: + with open(failed_func_hosts_file, "a") as f: + f.write(host+"\n") + print_out("adding %s to failed_func" %host) + clear_func_cert(currentclient) + else: + if cf < 3: + line="%s has less then 3 failues" %host.split(",")[0] + BBLINE="%s: %s failures (yellow) \n " %(currentclient, cf) + LINE = "status " + currentclient + ".func yellow" + " " + DATE + " " + BBLINE + cmd = BB + ' ' + BBDISP + ' "' + LINE + '"' + os.system(cmd) + print_out("sending yellow for %s" %currentclient) + else: + line="%s is already in failed func file" %host.split(",")[0] + clear_func_cert(currentclient) + print_out(line) + def readbb(): global hostlist global mythtype @@ -41,12 +128,10 @@ def readbb(): infile.close() for line in bbhostlist: cline=line.strip() - #if not cline.startswith("#") and cline != '' and cline.find("bbd") == -1 and cline.find("func") != -1 : if not cline.startswith("#") and cline != '' and cline.find("func") != -1 : host=cline.split("#") host=host[0].split() hostlist.append(host[1].strip()) - #print hostlist infile.close() try: infile = open('/etc/mythtv-releasetype') @@ -61,13 +146,16 @@ def find_local_myth_version(): local_pkg_name="not_found" pkgname="mythtv" pkgname+=mythtype - cmd="/usr/bin/pacman -Q %s " %pkgname - result = os.popen2(cmd)[1].readlines() + cmd="/usr/bin/pacman" + proc = subprocess.Popen([cmd, "-Q" , pkgname], stdout=subprocess.PIPE) + result=[] + result.append( proc.communicate()[0]) for list in result: l=list.strip() if l.startswith('mythtv') : local_pkg_name=l.strip() break + print_out("pkg name is: %s" %local_pkg_name ) return local_pkg_name @@ -117,13 +205,14 @@ hostlist = [] readbb() local_myth_version=find_local_myth_version() -for currentclient in hostlist: - #print currentclient +for currentclient_a in hostlist: + currentclient=currentclient_a.lower() + print currentclient cmd='/data/srv/xymon/server/bin/xymon 127.0.0.1 "query ' cmd+=currentclient cmd+='.conn"' bbresults=os.popen(cmd,'r' ).readline().strip().split() - + #check if host is active try: bbstate=bbresults[0] except: @@ -132,18 +221,18 @@ for currentclient in hostlist: #print bbstate if bbstate == 'green': try: - client = (fc.Client( currentclient )) + client = (fc.Client( currentclient.lower() )) except Exception as e: #couldn't find minion in certmaster - #print "couldn't find minion in certmaster:%s" %currentclient BBLINE="%s: %s (red) \n " %(currentclient,e) LINE = "status " + currentclient + ".func red" + " " + DATE + " " + BBLINE cmd = BB + ' ' + BBDISP + ' "' + LINE + '"' - cmd2= "echo " + currentclient + " >> /data/srv/httpd/htdocs/failed_func_hosts" - os.system(cmd2) os.system(cmd) BBCOLOR="red" send_myth_clear(currentclient) + add_to_failed_host(currentclient + ", func client error") + clear_func_cert(currentclient) + continue @@ -153,26 +242,24 @@ for currentclient in hostlist: #print results[currentclient] #print type(results[currentclient]) #print "----------" - if type(results[currentclient]) == str: + if "socket.error" in results[currentclient]: + print_out("socket error occured") + BBLINE="%s: %s (red) \n " %(currentclient,"socket error occured") + LINE = "status " + currentclient + ".func red" + " " + DATE + " " + BBLINE + cmd = BB + ' ' + BBDISP + ' "' + LINE + '"' + os.system(cmd) + add_to_failed_host(currentclient + ", socket error occured") + + + elif type(results[currentclient]) == str: if results[currentclient] == '12': + BBLINE="%s: success (green) \n " %currentclient LINE = "status " + currentclient + ".func green" + " " + DATE + " " + BBLINE cmd = BB + ' ' + BBDISP + ' "' + LINE + '"' os.system(cmd) #REMOVE HOST FROM FAILED_FUNC - #cmd='sed -i "/' + currentclient + '/d" /data/srv/httpd/htdocs/failed_func_hosts' - f = open("/data/srv/httpd/htdocs/failed_func_hosts") - failed_lines=f.readlines() - f.close - f = open("/data/srv/httpd/htdocs/failed_func_hosts",'w') - for line in failed_lines: - if line.strip() == currentclient: - continue - f.write(line) - f.close() - - - #os.system(cmd) + remove_from_failedfunc(currentclient) mythversion_check(currentclient,local_myth_version) else: BBLINE="%s: connected but wtf (yellow) \n " %currentclient @@ -185,33 +272,24 @@ for currentclient in hostlist: BBLINE="%s: %s (red) \n " %(currentclient,results[currentclient]) LINE = "status " + currentclient + ".func red" + " " + DATE + " " + BBLINE cmd = BB + ' ' + BBDISP + ' "' + LINE + '"' - cmd2= "echo " + currentclient + " >> /data/srv/httpd/htdocs/failed_func_hosts" - cmd3="sudo /usr/bin/certmaster-ca -c " + currentclient - os.system(cmd2) - os.system(cmd3) os.system(cmd) + add_to_failed_host(currentclient + ", test failed") + + BBCOLOR="red" + + except Exception as e: + print_out(e) + BBLINE="%s had an error : %s (red) \n " % (currentclient,str(results)) + LINE = "status " + currentclient + ".func red" + " " + DATE + " " + BBLINE + cmd = BB + ' ' + BBDISP + ' "' + LINE + '"' + os.system(cmd) + add_to_failed_host(currentclient + ", had an error") + BBCOLOR="red" - except: - BBLINE="%s had an error : %s (red) \n " % (currentclient,str(results)) - LINE = "status " + currentclient + ".func red" + " " + DATE + " " + BBLINE - cmd = BB + ' ' + BBDISP + ' "' + LINE + '"' - cmd2= "echo " + currentclient + " >> /data/srv/httpd/htdocs/failed_func_hosts" - os.system(cmd) - os.system(cmd2) - cmd3="sudo /usr/bin/certmaster-ca -c " + currentclient - os.system(cmd3) - BBCOLOR="red" else: - BBLINE+= "Not testing %s \n " % currentclient + BBLINE= "Not testing %s \n " % currentclient LINE = "status " + currentclient + ".func clear" + " " + DATE + " " + BBLINE cmd = BB + ' ' + BBDISP + ' "' + LINE + '"' os.system(cmd) BBCOLOR="clear" send_myth_clear(currentclient) - -#LINE = "status " + MACHINE + ".func green" + " " + DATE + " " + BBLINE -#cmd = BB + ' ' + BBDISP + ' "' + LINE + '"' -#os.system(cmd) - -#print BBLINE -#print BBCOLOR diff --git a/abs/core/xymon/hbnotes.py b/abs/core/xymon/hbnotes.py index e08992c..13dbd86 100644 --- a/abs/core/xymon/hbnotes.py +++ b/abs/core/xymon/hbnotes.py @@ -50,6 +50,7 @@ def main(argv): # create a cursor cursor = db.cursor() + #------------------------------write client-config------------------------------------------------ SQL="SELECT DISTINCT(hostname) from settings where hostname not in(%s)" cursor.execute(SQL %ignorehostlist) @@ -65,9 +66,8 @@ def main(argv): dotslave=list() dotslavefe=list() tunerdict = {} - currenthostype='' for row in result: - # print row[0] + #print row[0] #Find the system type cursor.execute("select value,data from settings where hostname=%s and value in ('HostSystemType','HostRunFrontend');",(row)) hostvalues=cursor.fetchall() @@ -94,64 +94,67 @@ def main(argv): tunerdict["MBE"]=tstring elif hostvalues[1][1] == 'Master_backend': - print "found MBE" - print hostvalues + if hostvalues[0][1]=='0': masterbackend+=","+row[0] - #dotMBE=row[0] + "\\n Master Backend" - #This is wrong, but it's enough to get it working - dotMBE='' + dotMBE="MBE" + " [ label=\"" + row[0] + " \\n Master Backend \" shapefile=\"/data/srv/httpd/htdocs/xymon/gifs/be.png\" fontcolor=\"white\" color=blue4 style=filled ] " else: masterbacked_w_fe+=","+row[0] dotMBE="MBE" + " [ label=\"" + row[0] + " \\n Master Backend with frontend \" shapefile=\"/data/srv/httpd/htdocs/xymon/gifs/be.png\" fontcolor=\"white\" color=blue4 style=filled ] " + dotfrontend.append(row[0]) cursor.execute("select cardtype,defaultinput from capturecard where hostname=%s;",(row)) tuners=cursor.fetchall() tstring="" - if len(tuners) == 0: - tunerdict["MBE"]="no tuners \\n" + + if len(tuners) <= 0: + tunerdict["MBE"]="no tuners \\n" else: - for t in tuners: - tstring+=t[0] - tstring+=t[1] - tstring+='\\n' - tunerdict["MBE"]=tstring - dotfrontend.append(row[0]) + #print tuners + for t in tuners: + tstring+=t[0] + tstring+=t[1] + tstring+='\\n' + tunerdict["MBE"]=tstring elif hostvalues[1][1] == 'Slave_backend': + cursor.execute("select cardtype,defaultinput from capturecard where hostname=%s;",(row)) + tuners=cursor.fetchall() + #slave withoutfe if hostvalues[0][1]=='0': slave+=","+row[0] dotslave.append(row[0]) - cursor.execute("select cardtype,defaultinput from capturecard where hostname=%s;",(row)) - tuners=cursor.fetchall() tstring="" - for t in tuners: - tstring+=t[0] - tstring+=t[1] - tstring+='\\n' - tunerdict["STUNER"+row[0]]=tstring - #dotfrontend.append(row[0]) + if len(tuners) <= 0: + tunerdict["STUNER"+row[0]]="No Tuners" + else: + for t in tuners: + tstring+=t[0] + tstring+=t[1] + tstring+='\\n' + tunerdict["STUNER"+row[0]]=tstring else: - cursor.execute("select cardtype,defaultinput from capturecard where hostname=%s;",(row)) - tuners=cursor.fetchall() + #slave with fe tstring="" - for t in tuners: - tstring+=t[0] - tstring+=t[1] - tstring+='\\n' - tunerdict["STUNER"+row[0]]=tstring - print tstring - + if len(tuners) <= 0: + tunerdict["STUNER"+row[0]]="No Tuners" + else: + for t in tuners: + tstring+=t[0] + tstring+=t[1] + tstring+='\\n' + tunerdict["STUNER"+row[0]]=tstring slave_w_fe+=","+row[0] dotslave.append(row[0]) dotfrontend.append(row[0]) + #----------------------------------Create graphviz dot files dotfilename="/data/srv/xymon/server/etc/mythdot" dotfile=open(dotfilename,'w') dotfile.write("digraph G { " + "\n" ) dotfile.write("graph [bgcolor=transparent]" + "\n" ) - + #print tunerdict #define the nodes dotfile.write( dotMBE + " \n" ) @@ -163,11 +166,16 @@ def main(argv): for fe in dotslave: cslave="STUNER"+fe + #adding tuners to dot file if tunerdict[cslave] != "" : - dotfile.write(cslave+ " [ label= \"" + tunerdict[cslave] + "\" , shape=box ] \n" ) + dotfile.write(cslave+ " [ label= \"" + tunerdict[cslave] + "\" , shapefile=\"/data/srv/httpd/htdocs/xymon/gifs/tuner.png\" fontcolor=\"white\" color=red ] \n" ) + #adding slave to dot file dotfile.write("SLAVE"+fe + "[ label=\"slave backend \\n " + fe + "\" shapefile=\"/data/srv/httpd/htdocs/xymon/gifs/be.png\" fontcolor=\"white\" color=green ] \n" ) + + + #connect up the nodes! dotfile.write("tunermbe -> MBE [color=\"red\"] \n " ) @@ -178,7 +186,7 @@ def main(argv): cslave="STUNER"+fe dotfile.write("SLAVE" + fe + "-> MBE [color=\"green\"] \n " ) if tunerdict[cslave] != "" : - dotfile.write(cslave + "-> SLAVE"+fe + "\n" ) + dotfile.write(cslave + "-> SLAVE"+fe + "[color=\"red\"]" "\n" ) @@ -186,58 +194,60 @@ def main(argv): dotfile.close() - cmd="/usr/bin/unflatten -l6 -c3 -f " + dotfilename + " |/usr/bin/dot -Tpng -o/data/srv/httpd/htdocs/xymon/gifs/network.png " + cmd="/usr/bin/unflatten -l1 -c3 -f " + dotfilename + " |/usr/bin/dot -Tpng -o/data/srv/httpd/htdocs/xymon/gifs/network.png " # cmd="/usr/bin/circo -Tpng -o/data/srv/httpd/htdocs/xymon/gifs/network.png " + dotfilename results=os.popen(cmd,'r') #-------------------------------------------------- #hobbitfile="/data/srv/xymon/server/etc/hobbit-clients.cfg" - hobbitfile="/data/srv/xymon/server/etc/tasks.cfg" - hobbitf=open(hobbitfile,'r') - hobbitconfig=hobbitf.readlines() - hobbitf.close() - hobbitf=open(hobbitfile,'w') - print "FE",frontonly - print "MBE",masterbackend - print "MBEwFW",masterbacked_w_fe - print "SLAVEwFW",slave_w_fe - print "SLAVE",slave - print "STD",stand_alone - - for line in hobbitconfig: - if line.startswith("HOST"): - cline=line.split("=") - if cline[1].startswith("_FRONTEND_"): - pline="HOST=" - pline+=frontonly.strip() - hobbitf.write(pline + "\n") - elif cline[1].startswith("_MASTERBACKEND_"): - pline="HOST=" - pline+=masterbackend.strip() - #print pline - hobbitf.write(pline+ "\n") - elif cline[1].startswith("_MASTERFRONTEND_"): - pline="HOST=" - pline+=masterbacked_w_fe.strip() - #print pline - hobbitf.write(pline+ "\n") - elif cline[1].startswith("_SLAVEBACKEND_"): - pline="HOST=" - pline+=slave.strip() - #print pline - hobbitf.write(pline+ "\n") - elif cline[1].startswith("_SLAVEFE_"): - pline="HOST=" - pline+=slave_w_fe.strip() - #print pline - hobbitf.write(pline+ "\n") - else: - #print line - hobbitf.write(line) - else: - #print line - hobbitf.write(line) + + ###WHY WAS THIS HERE?? + #hobbitfile="/data/srv/xymon/server/etc/tasks.cfg" + #hobbitf=open(hobbitfile,'r') + #hobbitconfig=hobbitf.readlines() + #hobbitf.close() + #hobbitf=open(hobbitfile,'w') + #print "FE",frontonly + #print "MBE",masterbackend + #print "MBEwFW",masterbacked_w_fe + #print "SLAVEwFW",slave_w_fe + #print "SLAVE",slave + #print "STD",stand_alone + + #for line in hobbitconfig: + #if line.startswith("HOST"): + #cline=line.split("=") + #if cline[1].startswith("_FRONTEND_"): + #pline="HOST=" + #pline+=frontonly.strip() + #hobbitf.write(pline + "\n") + #elif cline[1].startswith("_MASTERBACKEND_"): + #pline="HOST=" + #pline+=masterbackend.strip() + ##print pline + #hobbitf.write(pline+ "\n") + #elif cline[1].startswith("_MASTERFRONTEND_"): + #pline="HOST=" + #pline+=masterbacked_w_fe.strip() + ##print pline + #hobbitf.write(pline+ "\n") + #elif cline[1].startswith("_SLAVEBACKEND_"): + #pline="HOST=" + #pline+=slave.strip() + ##print pline + #hobbitf.write(pline+ "\n") + #elif cline[1].startswith("_SLAVEFE_"): + #pline="HOST=" + #pline+=slave_w_fe.strip() + ##print pline + #hobbitf.write(pline+ "\n") + #else: + ##print line + #hobbitf.write(line) + #else: + ##print line + #hobbitf.write(line) #-----------------------------------------------------------END CLIENT CONFIG diff --git a/abs/core/xymon/led_themes.tar.gz b/abs/core/xymon/led_themes.tar.gz Binary files differnew file mode 100644 index 0000000..b9bd1e1 --- /dev/null +++ b/abs/core/xymon/led_themes.tar.gz diff --git a/abs/core/xymon/logrotate-client.xymon b/abs/core/xymon/logrotate-client.xymon new file mode 100644 index 0000000..e1051aa --- /dev/null +++ b/abs/core/xymon/logrotate-client.xymon @@ -0,0 +1,14 @@ +/data/srv/xymon/client/logs/* { + missingok + daily + rotate 2 + compress + postrotate + if [ -f /service/xymon-client/run ] + then + sv hup xymon-client + fi + + endscript + +} diff --git a/abs/core/xymon/logrotate-server.xymon b/abs/core/xymon/logrotate-server.xymon new file mode 100644 index 0000000..e69c5d9 --- /dev/null +++ b/abs/core/xymon/logrotate-server.xymon @@ -0,0 +1,14 @@ +/var/log/hobbit/* { + missingok + daily + rotate 2 + compress + postrotate + if [ -f /service/xymon-server/run ] + then + sv hup xymon-server 2&>1 > /dev/null + fi + + endscript + +} diff --git a/abs/core/xymon/logrotate.xymon b/abs/core/xymon/logrotate.xymon deleted file mode 100644 index a86a0ba..0000000 --- a/abs/core/xymon/logrotate.xymon +++ /dev/null @@ -1,11 +0,0 @@ -/var/log/hobbit/* { - missingok - daily - rotate 2 - compress - postrotate - sv restart xymon-server - sv restart xymon-client - endscript - -} diff --git a/abs/core/xymon/xymon.install b/abs/core/xymon/xymon.install index 08fbd8c..ae6d3f1 100644 --- a/abs/core/xymon/xymon.install +++ b/abs/core/xymon/xymon.install @@ -26,7 +26,7 @@ post_install() { echo "Adding sudo permissions for http {backup_job}" LINE="nobody ALL = NOPASSWD:/usr/bin/certmaster-ca" LINE1="http ALL = NOPASSWD:/usr/MythVantage/bin/backup_job" - + setfacl -R -m u:nobody:rwx /data/srv/httpd/htdocs for i in "$LINE" "$LINE1" do cp /etc/sudoers /etc/sudoers.bak |