updates to monitor-server.spec and notes in 'todo' based on first attempt to
authorStephen Soltesz <soltesz@cs.princeton.edu>
Fri, 8 Aug 2008 22:37:35 +0000 (22:37 +0000)
committerStephen Soltesz <soltesz@cs.princeton.edu>
Fri, 8 Aug 2008 22:37:35 +0000 (22:37 +0000)
install and run this package within a myplc.

monitor-server.spec
nodeinfo.py
nodequery.py
todo

index a953e86..2c800d2 100644 (file)
@@ -29,6 +29,7 @@ Requires: coreutils
 Requires: openssh-clients
 Requires: PLCWWW >= 4.2
 Requires: BootCD >= 4.2
+Requires: MySQL-python
 
 %description
 Scripts for polling PLC, the node, and PCU status.  Also a collection of
@@ -46,6 +47,7 @@ echo "There is no build stage.  Simply copy files."
 rm -rf $RPM_BUILD_ROOT
 mkdir -p $RPM_BUILD_ROOT/usr/share/%{name}
 mkdir -p $RPM_BUILD_ROOT/var/lib/%{name}
+mkdir -p $RPM_BUILD_ROOT/var/lib/%{name}/archive-pdb
 mkdir -p $RPM_BUILD_ROOT/var/www/cgi-bin/monitor/
 
 echo " * Installing core scripts"
@@ -55,9 +57,10 @@ rsync -a --exclude www --exclude archive-pdb --exclude .svn --exclude CVS \
 echo " * Installing web pages"
 rsync -a www/ $RPM_BUILD_ROOT/var/www/cgi-bin/monitor/
 
-echo " * TODO: Installing cron job for automated polling"
-install -D -m 755 %{name}.cron $RPM_BUILD_ROOT/%{_sysconfdir}/cron.d/%{name}
+echo " * Installing cron job for automated polling"
+install -D -m 755 %{name}.cron $RPM_BUILD_ROOT/%{_sysconfdir}/cron.d/%{name}.cron
 echo " * TODO: Setting up Monitor account in local MyPLC"
+# TODO: 
 
 cp $RPM_BUILD_ROOT/usr/share/%{name}/monitorconfig-default.py $RPM_BUILD_ROOT/usr/share/%{name}/monitorconfig.py
 
@@ -80,6 +83,7 @@ echo "Post processing"
 # TODO: create monitorconfig.php using phpconfig.py 
 # TODO: create symlink in /var/lib/monitor-server for chroot environments
 # TODO: update the content of automate_pl03.sh 
+# TODO: Use the installed version of bootcd to create custom boot images. ( or, use the api now).
 
 #chkconfig --add monitor-server
 #chkconfig monitor-server on
index fc27781..84d8ae0 100755 (executable)
@@ -133,7 +133,10 @@ if config.findbad:
        os.system("./findbad.py --cachenodes --debug=0 --dbname=findbad --increment --nodelist %s" % file)
 
 fb = database.dbLoad("findbad")
-act_all = database.dbLoad("act_all")
+try:
+       act_all = database.dbLoad("act_all")
+except:
+       act_all = {}
 
 for node in config.args:
        config.node = node
@@ -146,7 +149,7 @@ for node in config.args:
 
        if fb_nodeinfo['pcu'] == "PCU":
                pcu = reboot.get_pcu_values(fb_nodeinfo['plcnode']['pcu_ids'][0])
-               pcu_print_info(pcu, config.node)
+               if pcu: pcu_print_info(pcu, config.node)
 
        if config.node in act_all and len(act_all[config.node]) > 0:
                header = [True]
index 87aad9f..b030344 100755 (executable)
@@ -6,7 +6,8 @@ api = plc.getAuthAPI()
 import sys
 import database
 from nodecommon import *
-from policy import Diagnose
+#from policy import Diagnose
+from unified_model import Record
 import glob
 import os
 from reboot import pcu_name
@@ -23,8 +24,8 @@ class NoKeyException(Exception): pass
 
 def daysdown_print_nodeinfo(fbnode, hostname):
        fbnode['hostname'] = hostname
-       fbnode['daysdown'] = Diagnose.getStrDaysDown(fbnode)
-       fbnode['intdaysdown'] = Diagnose.getDaysDown(fbnode)
+       fbnode['daysdown'] = Record.getStrDaysDown(fbnode)
+       fbnode['intdaysdown'] = Record.getDaysDown(fbnode)
 
        print "%(intdaysdown)5s %(hostname)-44s | %(state)10.10s | %(daysdown)s" % fbnode
 
diff --git a/todo b/todo
index 9ad2141..52a534b 100644 (file)
--- a/todo
+++ b/todo
@@ -1,5 +1,29 @@
 
 TODO:
+ * make 'automate.sh' be the real automate script for cron.
+ * install the right version of RT tools as a dependency?
+ * www/*.py need appropriate access to database.py,  config.py, monitorconfig.py, etc.
+ * build cmdamt with g++ prior to packaging
+ * install openssh-server, passwd, perl-libwww-perl (for rt), rt-3.4.1,  MySQL-python
+       * had to mount -t devpts devpts /dev/pts to get ssh to work inside the
+         chroot. also, disable the pam modules in /etc/pam.d/sshd
+ * threadpool package.
+ * reboot.py loads findbadpcus unconditionally.
+ * unified_model loads findbad unconditionally
+ * nodequery loads findbad unconditionally
+ * remove deps on www.printbadnodes
+ * change findbad.py default db name
+ * nodebad loads plc_hn2lb unconditionally
+ * nodeinfo loads act_all unconditionally
+
+ * A setup script of some kind would be nice that walked through : 
+    - writing monitorconfig.py
+       - creation of monitorconfig.php
+       - run syncplcdb.py
+       - testapi.py
+       - findbad.py on sample site.
+       - loads webpage for those retreived values to confirm setup succeeded.
+
  * reimplement the config.py / .config mechanism.  i'd like for many commands
    to share very similar argument or argument sets, as well as have some
    common config options.  I'm not sure the best way to do this.
@@ -31,6 +55,7 @@ TODO:
 
  * fix BayTechCtrlCUnibe expect script.
 
+
 Lower priority:
  * Add a more structured, 'automate' library of scripts and means of making
    batch calls, etc.