diff options
Diffstat (limited to 'abs/core/supplemental-web')
-rw-r--r-- | abs/core/supplemental-web/PKGBUILD | 12 | ||||
-rw-r--r-- | abs/core/supplemental-web/cgi/bestart.cgi | 6 | ||||
-rw-r--r-- | abs/core/supplemental-web/cgi/bestop.cgi | 6 | ||||
-rw-r--r-- | abs/core/supplemental-web/cgi/extra.cfg.txt | 7 | ||||
-rw-r--r-- | abs/core/supplemental-web/contents/count.py | 11 | ||||
-rw-r--r-- | abs/core/supplemental-web/contents/docs.html | 4 | ||||
-rw-r--r-- | abs/core/supplemental-web/contents/error/hobbit.html | 4 | ||||
-rw-r--r-- | abs/core/supplemental-web/contents/error/phpadmin.html | 2 | ||||
-rw-r--r-- | abs/core/supplemental-web/contents/header.jpg.mv | bin | 88341 -> 0 bytes | |||
-rw-r--r-- | abs/core/supplemental-web/contents/process.py | 40 | ||||
-rw-r--r-- | abs/core/supplemental-web/notify.py | 29 |
11 files changed, 45 insertions, 76 deletions
diff --git a/abs/core/supplemental-web/PKGBUILD b/abs/core/supplemental-web/PKGBUILD index 7c30873..40b1f7b 100644 --- a/abs/core/supplemental-web/PKGBUILD +++ b/abs/core/supplemental-web/PKGBUILD @@ -1,15 +1,11 @@ pkgname=supplemental-web pkgver=1.0 -pkgrel=10 +pkgrel=16 arch=('i686') MVDIR=$startdir/pkg/usr/MythVantage -#BINDIR=$MVDIR/bin install=supplemental-web.install -#depends=(unclutter ghosd ncid func wol ) -#binfiles="saytime.sh backup_job restore_job.sh update_system update_system_all backend_control.sh grabkey.py notify.py" -#source=($binfiles mfegdbcommands.txt mbegdbcommands.txt 45-event.rules lighttpd-supplement.conf) backup=('extra.cfg.txt') -source=(lighttpd-supplement.conf extra.cfg.txt wakeonlan.sh backend_control.sh notify.py) +source=(lighttpd-supplement.conf extra.cfg.txt wakeonlan.sh backend_control.sh) depends=('lighttpd' 'php' 'fcgi' 'python' 'xymonserver' 'certmaster' 'func' 'python_aosd' ) @@ -23,7 +19,6 @@ build() { install -m755 -D wakeonlan.sh $MVDIR/bin/wakeonlan.sh install -m755 -D backend_control.sh $MVDIR/bin/backend_control.sh -# install -m755 -D notify.py $MVDIR/bin/notify.py mkdir -p $startdir/pkg/data/srv/httpd/htdocs/ cp -rp $startdir/contents/* $startdir/pkg/data/srv/httpd/htdocs chmod -R 755 $startdir/pkg/data/srv/httpd/htdocs @@ -40,5 +35,4 @@ build() { md5sums=('2a9d042467220fd1f74f5b12730c2e06' '3d8c7b430c1319d706ca420825918d2a' '81cdb6ee6804fa36366c6e259a80e7b4' - 'f37e10ef9fc84b384b9a2d41f82ef744' - '4da05325b4f9d61d26f88c19578d1950') + 'f37e10ef9fc84b384b9a2d41f82ef744') diff --git a/abs/core/supplemental-web/cgi/bestart.cgi b/abs/core/supplemental-web/cgi/bestart.cgi index 10ca4ad..e09e42b 100644 --- a/abs/core/supplemental-web/cgi/bestart.cgi +++ b/abs/core/supplemental-web/cgi/bestart.cgi @@ -1,5 +1,9 @@ #!/bin/bash -sudo /sbin/sv start mythbackend +# MESSAGE="Trying to start `hostname` B.E." +# /usr/bin/func "*" call msg display "$MESSAGE" & + +sudo /sbin/sv start mythbackend + MESSAGE="`hostname` B.E. started" /usr/bin/func "*" call msg display "$MESSAGE" & diff --git a/abs/core/supplemental-web/cgi/bestop.cgi b/abs/core/supplemental-web/cgi/bestop.cgi index a65a16a..c9d7fad 100644 --- a/abs/core/supplemental-web/cgi/bestop.cgi +++ b/abs/core/supplemental-web/cgi/bestop.cgi @@ -1,5 +1,9 @@ #!/bin/bash -sudo /sbin/sv stop mythbackend +MESSAGE="Trying to stop `hostname` B.E." +/usr/bin/func "*" call msg display "$MESSAGE" & + +sudo /sbin/sv stop mythbackend + MESSAGE="`hostname` B.E. stopped" /usr/bin/func "*" call msg display "$MESSAGE" & diff --git a/abs/core/supplemental-web/cgi/extra.cfg.txt b/abs/core/supplemental-web/cgi/extra.cfg.txt new file mode 100644 index 0000000..cd4009a --- /dev/null +++ b/abs/core/supplemental-web/cgi/extra.cfg.txt @@ -0,0 +1,7 @@ +[extra] +# change any of the following to False or True +# This file is used to state to other machines in the cluster whats running +xymon = True +func = True +rsyslog_network = False + diff --git a/abs/core/supplemental-web/contents/count.py b/abs/core/supplemental-web/contents/count.py index 6d813c1..d59144a 100644 --- a/abs/core/supplemental-web/contents/count.py +++ b/abs/core/supplemental-web/contents/count.py @@ -14,7 +14,7 @@ def main(argv): # create a cursor cursor = db.cursor() # execute SQL statement - cursor.execute("SELECT unix_timestamp(starttime),unix_timestamp(endtime),title FROM oldrecorded ORDER by starttime;") + cursor.execute("SELECT unix_timestamp(starttime),unix_timestamp(endtime),title FROM oldrecorded where oldrecorded.recstatus = -3 ORDER by starttime;") result = cursor.fetchall() for row in result: @@ -58,7 +58,7 @@ def main(argv): print '<div id="content"> <p></p>' print '<table class="sample">' print "Top 20 Shows" - cursor.execute("select title,count(title),category as numtitle from oldrecorded group by title having (COUNT(title) > 1) order by (COUNT(title)) DESC limit 20;" ) + cursor.execute("select title,count(title),category as numtitle from oldrecorded where oldrecorded.recstatus = -3 group by title having (COUNT(title) > 0 ) order by (COUNT(title)) DESC limit 20;" ) result = cursor.fetchall() for row in result: print " <tr>" @@ -74,11 +74,14 @@ def main(argv): print '<div id="column"></div>' print '<table class="sample">' print "Top 20 Categories" - cursor.execute("select category,count(category) as numtitle from oldrecorded group by category having (COUNT(category) > 1) order by (COUNT(category)) DESC limit 20; " ) + cursor.execute("select category,count(category) as numtitle from oldrecorded where oldrecorded.recstatus = -3 group by category having (COUNT(category) > 0 ) order by (COUNT(category)) DESC limit 20; " ) result = cursor.fetchall() for row in result: + category = row[0] + if category == "": + category = "Unknown" print " <tr>" - print " <td>",row[0],"</td>" + print " <td>",category,"</td>" print " <td>",row[1],"</td>" print " </tr>" #print "%16s %16s" %(row[0],row[1]) diff --git a/abs/core/supplemental-web/contents/docs.html b/abs/core/supplemental-web/contents/docs.html index c4a934b..4a5e64a 100644 --- a/abs/core/supplemental-web/contents/docs.html +++ b/abs/core/supplemental-web/contents/docs.html @@ -35,10 +35,6 @@ Starting and stopping services. <br> <ul id="navlist"> <li>The root password is blank. You will not be able to remotely access this account until the password is set.</li> - <li>The mythtv account is locked, reset the password if you wish login with this account.</li> - <li>The mythtv account has full sudo privileges. </li> - <li>All access from public ip address are blocked. Edit /etc/hosts.deny /etc/hosts.allow to change this.</li> - <li>Mythfilldatabase will automaticlly run when mythbackend is started. If the last attempt was successful then it will skip this step and mythfilldatabase will run normally.</li> <li>To keep a host from showing up in the network map, add it to: /data/srv/hobbit/server/ext/ignoreclient.py </li> diff --git a/abs/core/supplemental-web/contents/error/hobbit.html b/abs/core/supplemental-web/contents/error/hobbit.html index 18450f2..4c65716 100644 --- a/abs/core/supplemental-web/contents/error/hobbit.html +++ b/abs/core/supplemental-web/contents/error/hobbit.html @@ -4,8 +4,8 @@ </head> <body> -Hobbit does not appear to be installed. +Xymon does not appear to be installed. </br> -Please visit the MythVantage advanced screen to enable Hobbit. +If Xymon was just installed/started it will take a few minutes before this page populates. </body> </html> diff --git a/abs/core/supplemental-web/contents/error/phpadmin.html b/abs/core/supplemental-web/contents/error/phpadmin.html index dbdd4d3..39b2f48 100644 --- a/abs/core/supplemental-web/contents/error/phpadmin.html +++ b/abs/core/supplemental-web/contents/error/phpadmin.html @@ -16,8 +16,6 @@ pacman -S phpmyadmin </br> PHP must be enabled for phpMyAdmin. </br> -The easiest way to enable php is to enable Mythweb under the advanced settings for MythVantage. -</br> </br> </br> diff --git a/abs/core/supplemental-web/contents/header.jpg.mv b/abs/core/supplemental-web/contents/header.jpg.mv Binary files differdeleted file mode 100644 index 3bf128e..0000000 --- a/abs/core/supplemental-web/contents/header.jpg.mv +++ /dev/null diff --git a/abs/core/supplemental-web/contents/process.py b/abs/core/supplemental-web/contents/process.py index 93d16d9..9098ad6 100644 --- a/abs/core/supplemental-web/contents/process.py +++ b/abs/core/supplemental-web/contents/process.py @@ -99,11 +99,11 @@ def isblank(indict): def go_backup(myhost): myhostname = socket.gethostname() results="Nothing happened" - if myhostname.strip() == myhost.strip(): - command= "sudo /usr/MythVantage/bin/backup_job" - command2="sleep 1; /data/srv/hobbit/server/ext/hbnotes.py" - results=os.popen(command,'r') - os.popen(command2,'r') + command= "sudo /usr/LH/bin/lh_system_backup_job" + print command + command2="sleep 1; /data/srv/hobbit/server/ext/hbnotes.py" + results=os.popen(command,'r') + os.popen(command2,'r') return results @@ -122,28 +122,20 @@ def go_restore(restorefile,myhost): return results def go_optimize(myhost): - myhostname = socket.gethostname() - if myhostname.strip() == myhost.strip(): - command="/usr/LH/bin/optimize_mythdb.py" - results=os.popen(command,'r') - else: - results='This host does not run a database' + #myhostname = socket.gethostname() + #if myhostname.strip() == myhost.strip(): + command="/usr/LH/bin/optimize_mythdb.py" + print command + results=os.popen(command,'r') + #else: + #results='This host does not run a database' return results def go_update(myhost,update_type): - myhostname = socket.gethostname() - if myhostname.strip() == myhost.strip(): - cmd="sudo /usr/bin/update_system " - command=cmd + update_type - - else: - cmd=" call pacman update_system " - cmd+=update_type - command="/usr/bin/func \"" + myhost.strip() + "*\" " + cmd - print command - - #print command - + cmd=" call pacman update_system " + cmd+=update_type + command="/usr/bin/func \"" + myhost.strip() + "*\" " + cmd + print command results=os.popen(command,'r') return results diff --git a/abs/core/supplemental-web/notify.py b/abs/core/supplemental-web/notify.py deleted file mode 100644 index 2e520c5..0000000 --- a/abs/core/supplemental-web/notify.py +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/python -# import MySQL module - -import MySQLdb -import sys -import getopt -import socket -import os - -def main(argv): - db = MySQLdb.connect(host="localhost", user="mythtv", passwd="mythtv", db="mythconverg") - # create a cursor - cursor = db.cursor() - # execute SQL statement - cursor.execute("SELECT DISTINCT(hostname) from settings where not hostname is NULL") - result = cursor.fetchall() - message = sys.argv[2] - messagetype = sys.argv[1] - port=str(5000) - if messagetype == "PH2": - port=str(5001) - - - message = message + " :::" + messagetype - for row in result: - os.system("/usr/bin/osdClient.pl " + row[0] + " " + port + " "+ "\"" + message + "\"" + "&" ) - -if __name__ == "__main__": - main(sys.argv[1:]) |