install and run this package within a myplc.
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
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"
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
# 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
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
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]
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
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
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.
* fix BayTechCtrlCUnibe expect script.
+
Lower priority:
* Add a more structured, 'automate' library of scripts and means of making
batch calls, etc.