add spec files for the server-side rpm package of monitor
authorStephen Soltesz <soltesz@cs.princeton.edu>
Wed, 30 Jul 2008 19:36:04 +0000 (19:36 +0000)
committerStephen Soltesz <soltesz@cs.princeton.edu>
Wed, 30 Jul 2008 19:36:04 +0000 (19:36 +0000)
Monitor-server.spec [new file with mode: 0644]
monitor-server.cron [new file with mode: 0644]

diff --git a/Monitor-server.spec b/Monitor-server.spec
new file mode 100644 (file)
index 0000000..9e998a3
--- /dev/null
@@ -0,0 +1,79 @@
+#
+# $Id$
+# 
+
+%define url $URL: svn+ssh://svn.planet-lab.org/svn/Monitor/trunk/Monitor-server.spec $
+
+%define name monitor-server
+%define version 1.0
+%define taglevel 5
+
+%define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
+
+Summary: Monitor backend scripts for server
+Name: %{name}
+Version: %{version}
+Release: %{release}
+Source0: %{name}-%{version}.tar.bz2
+License: GPL
+Group: Applications/System
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
+
+Vendor: PlanetLab
+Packager: PlanetLab Central <support@planet-lab.org>
+Distribution: PlanetLab %{plrelease}
+URL: %(echo %{url} | cut -d ' ' -f 2)
+
+Requires: curl
+Requires: coreutils
+Requires: PLCWWW >= 4.2
+
+%description
+Scripts for polling PLC, the node, and PCU status.  Also a collection of
+command-line utilities for querying the status database. 
+
+%prep
+%setup -q
+
+%build
+echo "There is no build stage.  Simply copy files."
+
+%install
+
+rm -rf $RPM_BUILD_ROOT
+mkdir -p $RPM_BUILD_ROOT/usr/share/%{name}
+mkdir -p $RPM_BUILD_ROOT/usr/share/%{name}/archive-pdb
+mkdir -p $RPM_BUILD_ROOT/var/www/cgi-bin/monitor/
+
+echo " * Installing core scripts"
+rsync -a --exclude www --exclude archive-pdb \
+      --exclude .svn --exclude CVS \
+         ./ $RPM_BUILD_ROOT/usr/share/%{name}/
+
+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 " * TODO: Setting up Monitor account in local MyPLC"
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root)
+# define a %config entry for /var/share/%{name}/xyz?
+/usr/share/%{name}
+/var/www/cgi-bin/monitor
+%{_sysconfdir}/cron.d/%{name}
+
+%post
+echo "Post processing"
+# TODO: this will be nice when we have a web-based service running., such as
+#              an API server or so on.
+#chkconfig --add monitor-server
+#chkconfig monitor-server on
+
+%changelog
+* Wed Jul 30 2008 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-server-1.0-5
+- initial creation of server-side package
diff --git a/monitor-server.cron b/monitor-server.cron
new file mode 100644 (file)
index 0000000..dc5302e
--- /dev/null
@@ -0,0 +1,5 @@
+# Runs every three hours to poll all nodes and PCUs, as well as take some
+# automated actions for debug nodes.
+
+01 6,9,12,15,18,21 * * * root /usr/share/monitor-server/automate.sh
+