Index: /trunk/Makefile
===================================================================
--- /trunk/Makefile	(revision 378)
+++ /trunk/Makefile	(revision 378)
@@ -0,0 +1,45 @@
+TMPDIR = /tmp
+WEBDIR = /var/www/ganglia
+
+VERSION = 0.2.1
+RELEASE = 1
+
+OPWD = `pwd`
+
+REQUIRED = ./jobarchived ./jobmond ./web
+
+debian:	debian-jobmond
+
+#rpm-binary:
+
+#all:	tarball debian-binary rpm-binary
+
+tarball:	tarball-gzip tarball-bzip
+
+tarball-gzip:	${REQUIRED}
+	mkdir -p ${TMPDIR}/.monarch_buildroot/ganglia_jobmonarch-${VERSION}
+	( rsync -a --exclude=.svn . ${TMPDIR}/.monarch_buildroot/ganglia_jobmonarch-${VERSION} )
+	( cd ${TMPDIR}/.monarch_buildroot; tar zcvf ganglia_jobmonarch-${VERSION}.tar.gz ./ganglia_jobmonarch-${VERSION} )
+	cp ${TMPDIR}/.monarch_buildroot/ganglia_jobmonarch-${VERSION}.tar.gz .
+
+tarball-bzip:	${REQUIRED}
+	mkdir -p ${TMPDIR}/.monarch_buildroot/ganglia_jobmonarch-${VERSION}
+	( rsync -a --exclude=.svn . ${TMPDIR}/.monarch_buildroot/ganglia_jobmonarch-${VERSION} )
+	( cd ${TMPDIR}/.monarch_buildroot; tar jcvf ganglia_jobmonarch-${VERSION}.tar.bz2 ./ganglia_jobmonarch-${VERSION} )
+	cp ${TMPDIR}/.monarch_buildroot/ganglia_jobmonarch-${VERSION}.tar.bz2 .
+
+debian-jobmond:	${REQUIRED}
+	mkdir -p ${TMPDIR}/.monarch_buildroot/jobmonarch-jobmond_${VERSION}-${RELEASE}>/dev/null >/dev/null
+	mkdir -p ${TMPDIR}/.monarch_buildroot/jobmonarch-jobmond_${VERSION}-${RELEASE}/etc/init.d >/dev/null
+	mkdir -p ${TMPDIR}/.monarch_buildroot/jobmonarch-jobmond_${VERSION}-${RELEASE}/usr/bin >/dev/null
+	install -m 755 jobmond/jobmond.py ${TMPDIR}/.monarch_buildroot/jobmonarch-jobmond_${VERSION}-${RELEASE}/usr/bin
+	( cd ${TMPDIR}/.monarch_buildroot/jobmonarch-jobmond_${VERSION}-${RELEASE}/usr/bin; ln -s jobmond.py jobmond )
+	install jobmond/jobmond.conf ${TMPDIR}/.monarch_buildroot/jobmonarch-jobmond_${VERSION}-${RELEASE}/etc
+	install pkg/init.d/jobmond ${TMPDIR}/.monarch_buildroot/jobmonarch-jobmond_${VERSION}-${RELEASE}/etc/init.d
+	( cp -a pkg/deb/jobmond/DEBIAN ${TMPDIR}/.monarch_buildroot/jobmonarch-jobmond_${VERSION}-${RELEASE}/ )
+	( cd ${TMPDIR}/.monarch_buildroot/; cat jobmonarch-jobmond_${VERSION}-${RELEASE}/DEBIAN/control | sed "s/^Version:.*$//Version: 0.2.1-1/g" >jobmonarch-jobmond_${VERSION}-${RELEASE}/DEBIAN/control.new; mv jobmonarch-jobmond_${VERSION}-${RELEASE}/DEBIAN/control.new jobmonarch-jobmond_${VERSION}-${RELEASE}/DEBIAN/control )
+	( cd ${TMPDIR}/.monarch_buildroot/; fakeroot dpkg -b jobmonarch-jobmond_${VERSION}-${RELEASE} )
+	cp ${TMPDIR}/.monarch_buildroot/jobmonarch-jobmond_${VERSION}-${RELEASE}.deb .
+
+clean:	${TMPDIR}/.monarch_buildroot
+	rm -rf ${TMPDIR}/.monarch_buildroot
Index: /trunk/pkg/deb/jobarchived/DEBIAN/control
===================================================================
--- /trunk/pkg/deb/jobarchived/DEBIAN/control	(revision 378)
+++ /trunk/pkg/deb/jobarchived/DEBIAN/control	(revision 378)
@@ -0,0 +1,10 @@
+Package: jobmonarch-jobarchived
+Version: 0.2-1
+Section: misc
+Priority: optional
+Architecture: all
+Essential: no
+Depends: python, gmetad, rrdtool, postgresql, ganglia-webfrontend
+Installed-Size: 76K
+Maintainer: Ramon Bastiaans <bastiaans@sara.nl>
+Description: Job Archiving Daemon
Index: /trunk/pkg/deb/jobarchived/DEBIAN/postinst
===================================================================
--- /trunk/pkg/deb/jobarchived/DEBIAN/postinst	(revision 378)
+++ /trunk/pkg/deb/jobarchived/DEBIAN/postinst	(revision 378)
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+PATH=/bin:/sbin:/usr/bin:/usr/sbin
+
+if [ -x /etc/init.d/jobarchived ] && [ -x /usr/sbin/jobarchived ]
+	then
+
+		if [ -d /usr/sara ]
+			then
+				update-rc.d -f jobarchived start 99 3 . stop 99 0 1 2 6 .
+			else
+				update-rc.d -f jobarchived defaults
+		fi
+
+fi
+
+echo ""
+echo "Additional manual changes are required to setup jobarchived:"
+echo ""
+echo "1) Edit /etc/jobarchived.conf to reflect your local settings and setup:"
+echo "   - ARCHIVE_DATASOURCES and ARCHIVE_PATH"
+echo ""
+echo "2) Create a 'jobarchive' database and create jobarchived's tables:" 
+echo "   - createdb jobarchive"
+echo "   - psql -f /usr/share/jobarchived/job_dbase.sql jobarchive"
+echo ""
Index: /trunk/pkg/deb/jobarchived/DEBIAN/postrm
===================================================================
--- /trunk/pkg/deb/jobarchived/DEBIAN/postrm	(revision 378)
+++ /trunk/pkg/deb/jobarchived/DEBIAN/postrm	(revision 378)
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+PATH=/bin:/sbin:/usr/bin:/usr/sbin
+
+update-rc.d -f jobarchived remove
Index: /trunk/pkg/deb/jobarchived/DEBIAN/prerm
===================================================================
--- /trunk/pkg/deb/jobarchived/DEBIAN/prerm	(revision 378)
+++ /trunk/pkg/deb/jobarchived/DEBIAN/prerm	(revision 378)
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+/etc/init.d/jobarchived stop
Index: /trunk/pkg/deb/jobmond/DEBIAN/conffiles
===================================================================
--- /trunk/pkg/deb/jobmond/DEBIAN/conffiles	(revision 378)
+++ /trunk/pkg/deb/jobmond/DEBIAN/conffiles	(revision 378)
@@ -0,0 +1,1 @@
+/etc/jobmond.conf
Index: /trunk/pkg/deb/jobmond/DEBIAN/control
===================================================================
--- /trunk/pkg/deb/jobmond/DEBIAN/control	(revision 378)
+++ /trunk/pkg/deb/jobmond/DEBIAN/control	(revision 378)
@@ -0,0 +1,10 @@
+Package: jobmonarch-jobmond
+Version: 0.2-1
+Section: misc
+Priority: optional
+Architecture: all
+Essential: no
+Depends: python, pbs-python, ganglia-monitor
+Installed-Size: 44K
+Maintainer: Ramon Bastiaans <bastiaans@sara.nl>
+Description: Job Monitoring Daemon
Index: /trunk/pkg/deb/jobmond/DEBIAN/postinst
===================================================================
--- /trunk/pkg/deb/jobmond/DEBIAN/postinst	(revision 378)
+++ /trunk/pkg/deb/jobmond/DEBIAN/postinst	(revision 378)
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+PATH=/bin:/sbin:/usr/bin:/usr/sbin
+
+if [ -x /etc/init.d/jobmond ] && [ -x /usr/sbin/jobmond ]
+	then
+
+		update-rc.d -f jobmond defaults
+
+fi
+
+/etc/init.d/jobmond restart
Index: /trunk/pkg/deb/jobmond/DEBIAN/postrm
===================================================================
--- /trunk/pkg/deb/jobmond/DEBIAN/postrm	(revision 378)
+++ /trunk/pkg/deb/jobmond/DEBIAN/postrm	(revision 378)
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+PATH=/bin:/sbin:/usr/bin:/usr/sbin
+
+update-rc.d -f jobmond remove
Index: /trunk/pkg/deb/jobmond/DEBIAN/prerm
===================================================================
--- /trunk/pkg/deb/jobmond/DEBIAN/prerm	(revision 378)
+++ /trunk/pkg/deb/jobmond/DEBIAN/prerm	(revision 378)
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+/etc/init.d/jobmond stop
Index: /trunk/pkg/deb/web/DEBIAN/conffiles
===================================================================
--- /trunk/pkg/deb/web/DEBIAN/conffiles	(revision 378)
+++ /trunk/pkg/deb/web/DEBIAN/conffiles	(revision 378)
@@ -0,0 +1,1 @@
+/var/www/ganglia/addons/job_monarch/conf.php
Index: /trunk/pkg/deb/web/DEBIAN/control
===================================================================
--- /trunk/pkg/deb/web/DEBIAN/control	(revision 378)
+++ /trunk/pkg/deb/web/DEBIAN/control	(revision 378)
@@ -0,0 +1,10 @@
+Package: jobmonarch-webfrontend
+Version: 0.2-1
+Section: misc
+Priority: optional
+Architecture: all
+Essential: no
+Depends: php4 | php5, php4-gd | php5-gd, rrdtool, ganglia-webfrontend
+Installed-Size: 304K
+Maintainer: Ramon Bastiaans <bastiaans@sara.nl>
+Description: Job MonArch's Web Frontend
Index: /trunk/pkg/deb/web/DEBIAN/postinst
===================================================================
--- /trunk/pkg/deb/web/DEBIAN/postinst	(revision 378)
+++ /trunk/pkg/deb/web/DEBIAN/postinst	(revision 378)
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+echo "Make sure to set your Ganglia template to job_monarch now"
+echo "" 
+echo "In your Ganglia conf.php, set this line:"
+echo "$template_name = \"job_monarch\";"
Index: /trunk/pkg/deb/web/DEBIAN/postrm
===================================================================
--- /trunk/pkg/deb/web/DEBIAN/postrm	(revision 378)
+++ /trunk/pkg/deb/web/DEBIAN/postrm	(revision 378)
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+echo "Dont forget to set your Ganglia template back to default"
Index: /trunk/pkg/init.d/jobarchived
===================================================================
--- /trunk/pkg/init.d/jobarchived	(revision 378)
+++ /trunk/pkg/init.d/jobarchived	(revision 378)
@@ -0,0 +1,42 @@
+#! /bin/sh
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/sbin/jobarchived
+NAME=jobarchived
+DESC="Job Archive Daemon"
+
+export PYTHONPATH=/usr/share/jobarchived:$PYTHONPATH
+
+test -x $DAEMON || exit 0
+
+set -e
+
+case "$1" in
+  start)
+	echo -n "Starting $DESC: "
+	start-stop-daemon --start --quiet -m --pidfile /var/run/$NAME.pid \
+		--exec $DAEMON 
+	sleep 1
+	ps -ef | grep jobarchived$ | awk '{ print $2 }' >/var/run/$NAME.pid
+	echo "$NAME."
+	;;
+  stop)
+	echo -n "Stopping $DESC: "
+        start-stop-daemon --stop  --quiet --oknodo --name $DAEMON \
+                2>&1 > /dev/null
+	sleep 1
+	test -f /var/run/$NAME.pid && MYPID=`cat /var/run/$NAME.pid`
+	test ! -z $MYPID && ps $MYPID 2>&1 > /dev/null && kill -9 $MYPID 2>&1 > /dev/null
+	echo "$NAME."
+	;;
+  restart|force-reload)
+	$0 stop
+	$0 start
+	;;
+  *)
+	echo "Usage: $N {start|stop|restart}" >&2
+	exit 1
+	;;
+esac
+
+exit 0
Index: /trunk/pkg/init.d/jobmond
===================================================================
--- /trunk/pkg/init.d/jobmond	(revision 378)
+++ /trunk/pkg/init.d/jobmond	(revision 378)
@@ -0,0 +1,35 @@
+#! /bin/sh
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/sbin/jobmond
+NAME=jobmond
+DESC="Job Monitor Daemon"
+
+test -x $DAEMON || exit 0
+
+set -e
+
+case "$1" in
+  start)
+	echo -n "Starting $DESC: "
+	start-stop-daemon --start --quiet -m --pidfile /var/run/$NAME.pid \
+		--exec $DAEMON 
+	echo "$NAME."
+	;;
+  stop)
+	echo -n "Stopping $DESC: "
+        start-stop-daemon --stop  --quiet --oknodo --name $DAEMON \
+                2>&1 > /dev/null
+	echo "$NAME."
+	;;
+  restart|force-reload)
+	$0 stop
+	$0 start
+	;;
+  *)
+	echo "Usage: $N {start|stop|restart}" >&2
+	exit 1
+	;;
+esac
+
+exit 0
Index: /trunk/pkg/rpm/jobmonarch-jobarchived.spec
===================================================================
--- /trunk/pkg/rpm/jobmonarch-jobarchived.spec	(revision 378)
+++ /trunk/pkg/rpm/jobmonarch-jobarchived.spec	(revision 378)
@@ -0,0 +1,64 @@
+Buildroot: 
+Name: jobmonarch-jobarchived
+Version: 
+Release: 
+Summary: Job Archiving Daemon
+License: see /usr/share/doc/jobmonarch-jobarchived/copyright
+Distribution: Debian
+Group: Converted/misc
+
+%define _rpmdir ../
+%define _rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
+%define _unpackaged_files_terminate_build 0
+
+%post
+#!/bin/sh
+
+PATH=/bin:/sbin:/usr/bin:/usr/sbin
+
+if [ -x /etc/init.d/jobarchived ] && [ -x /usr/sbin/jobarchived ]
+	then
+
+		chkconfig jobarchived on
+
+fi
+
+echo ""
+echo "Additional manual changes are required to setup jobarchived:"
+echo ""
+echo "1) Edit /etc/jobarchived.conf to reflect your local settings and setup:"
+echo "   - ARCHIVE_DATASOURCES and ARCHIVE_PATH"
+echo ""
+echo "2) Create a 'jobarchive' database and create jobarchived's tables:" 
+echo "   - createdb jobarchive"
+echo "   - psql -f /usr/share/jobarchived/job_dbase.sql jobarchive"
+echo ""
+
+
+%preun
+#!/bin/sh
+
+/etc/init.d/jobarchived stop
+
+
+%postun
+#!/bin/sh
+
+PATH=/bin:/sbin:/usr/bin:/usr/sbin
+
+chkconfig jobarchived off
+
+
+%description
+
+
+Job MonArch's archive daemon
+
+%files
+"/usr/sbin/jobarchived.py"
+"/etc/init.d/jobarchived"
+"/etc/jobarchived.conf-dist"
+"/usr/sbin/jobarchived"
+%dir "/usr/share/jobarchived/"
+"/usr/share/jobarchived/DBClass.py"
+"/usr/share/jobarchived/job_dbase.sql"
Index: /trunk/pkg/rpm/jobmonarch-jobmond.spec
===================================================================
--- /trunk/pkg/rpm/jobmonarch-jobmond.spec	(revision 378)
+++ /trunk/pkg/rpm/jobmonarch-jobmond.spec	(revision 378)
@@ -0,0 +1,52 @@
+Buildroot: 
+Name: jobmonarch-jobmond
+Version: 
+Release: 
+Summary: Job Monitoring Daemon
+License: see /usr/share/doc/jobmonarch-jobmond/copyright
+Distribution: Debian
+Group: Converted/misc
+
+%define _rpmdir ../
+%define _rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
+%define _unpackaged_files_terminate_build 0
+
+%post
+#!/bin/sh
+
+PATH=/bin:/sbin:/usr/bin:/usr/sbin
+
+if [ -x /etc/init.d/jobmond ] && [ -x /usr/sbin/jobmond ]
+	then
+
+		chkconfig jobmond on
+
+fi
+
+/etc/init.d/jobmond restart
+
+
+%preun
+#!/bin/sh
+
+/etc/init.d/jobmond stop
+
+
+%postun
+#!/bin/sh
+
+PATH=/bin:/sbin:/usr/bin:/usr/sbin
+
+chkconfig jobmond off
+
+
+%description
+
+
+Job MonArch's monitoring daemon.
+
+%files
+"/etc/init.d/jobmond"
+"/usr/sbin/jobmond.py"
+"/usr/sbin/jobmond"
+%config "/etc/jobmond.conf"
Index: /trunk/pkg/rpm/jobmonarch-webfrontend.spec
===================================================================
--- /trunk/pkg/rpm/jobmonarch-webfrontend.spec	(revision 378)
+++ /trunk/pkg/rpm/jobmonarch-webfrontend.spec	(revision 378)
@@ -0,0 +1,68 @@
+Buildroot: 
+Name: jobmonarch-webfrontend
+Version: 
+Release: 
+Summary: Job MonArch's Web Frontend
+License: see /usr/share/doc/jobmonarch-webfrontend/copyright
+Distribution: Debian
+Group: Converted/misc
+
+%define _rpmdir ../
+%define _rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
+%define _unpackaged_files_terminate_build 0
+
+%post
+#!/bin/sh
+
+echo "Make sure to set your Ganglia template to job_monarch now"
+echo "" 
+echo "In your Ganglia conf.php, set this line:"
+echo "$template_name = \"job_monarch\";"
+
+
+%postun
+#!/bin/sh
+
+echo "Dont forget to set your Ganglia template back to default"
+
+
+%description
+
+
+Job Monarch's web frontend.
+
+%files
+%dir "/var/www/ganglia/templates/job_monarch/"
+%dir "/var/www/ganglia/templates/job_monarch/images/"
+"/var/www/ganglia/templates/job_monarch/cluster_extra.tpl"
+"/var/www/ganglia/templates/job_monarch/host_extra.tpl"
+%dir "/var/www/ganglia/addons/job_monarch/"
+%dir "/var/www/ganglia/addons/job_monarch/templates/"
+"/var/www/ganglia/addons/job_monarch/templates/overview.tpl"
+"/var/www/ganglia/addons/job_monarch/templates/search.tpl"
+"/var/www/ganglia/addons/job_monarch/templates/footer.tpl"
+"/var/www/ganglia/addons/job_monarch/templates/header.tpl"
+"/var/www/ganglia/addons/job_monarch/templates/host_view.tpl"
+"/var/www/ganglia/addons/job_monarch/templates/index.tpl"
+%config "/var/www/ganglia/addons/job_monarch/conf.php"
+"/var/www/ganglia/addons/job_monarch/search.php"
+"/var/www/ganglia/addons/job_monarch/libtoga.php"
+"/var/www/ganglia/addons/job_monarch/version.php"
+"/var/www/ganglia/addons/job_monarch/cal.gif"
+"/var/www/ganglia/addons/job_monarch/document_archive.jpg"
+"/var/www/ganglia/addons/job_monarch/graph.php"
+"/var/www/ganglia/addons/job_monarch/header.php"
+"/var/www/ganglia/addons/job_monarch/host_view.php"
+"/var/www/ganglia/addons/job_monarch/image.php"
+"/var/www/ganglia/addons/job_monarch/libtoga.js"
+"/var/www/ganglia/addons/job_monarch/logo_ned.gif"
+"/var/www/ganglia/addons/job_monarch/next.gif"
+"/var/www/ganglia/addons/job_monarch/prev.gif"
+"/var/www/ganglia/addons/job_monarch/redcross.jpg"
+"/var/www/ganglia/addons/job_monarch/ts_picker.js"
+"/var/www/ganglia/addons/job_monarch/ts_validatetime.js"
+"/var/www/ganglia/addons/job_monarch/footer.php"
+"/var/www/ganglia/addons/job_monarch/styles.css"
+"/var/www/ganglia/addons/job_monarch/index.php"
+"/var/www/ganglia/addons/job_monarch/overview.php"
+"/var/www/ganglia/templates/job_monarch/images/logo.jpg"
