5 %define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
7 Summary: PlanetLab node monitoring tools
12 Group: System Environment/Kernel
13 Source: %{name}-%{version}.tgz
15 Packager: PlanetLab Central <support@planet-lab.org>
16 Distribution: PlanetLab 3.0
17 URL: http://cvs.planet-lab.org/cvs/pl_mom
18 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
20 # swapmon requires vps and bwlimit.py
21 Requires: util-vserver, util-vserver-python
26 pl_mom is a suite of PlanetLab node monitoring tools.
28 swapmon is a swap monitoring daemon. Every 30 seconds, it checks
29 process memory usage. At 90% utilization, resets the slice that is
30 consuming the most physical memory. At 95% utilization, it reboots the
31 machine to avoid a crash.
33 pl_mop is a cron job that "fixes" various common problems with nodes
34 (dead services, ext3 corruption, zombie SSH sessions, etc.).
42 rm -rf $RPM_BUILD_ROOT
45 install -D -m 644 pl_mom.py $RPM_BUILD_ROOT/%{_datadir}/%{name}/pl_mom.py
47 # Bandwidth monitor (bwmon), run periodically
48 #install -D -m 755 bwmon.py $RPM_BUILD_ROOT/%{_datadir}/%{name}/bwmon.py
50 # Swap monitoring daemon (swapmon)
51 install -D -m 755 swapmon.py $RPM_BUILD_ROOT/%{_datadir}/%{name}/swapmon.py
52 install -D -m 755 swapmon.init $RPM_BUILD_ROOT/%{_initrddir}/swapmon
55 install -D -m 755 pl_mop.sh $RPM_BUILD_ROOT/usr/bin/pl_mop.sh
57 # Runs pl_mop and bwmon periodically
58 install -D -m 644 pl_mom.cron $RPM_BUILD_ROOT/%{_sysconfdir}/cron.d/pl_mom
61 rm -rf $RPM_BUILD_ROOT
64 if [ "$PL_BOOTCD" != "1" ] ; then
71 chkconfig --add swapmon
73 if [ "$PL_BOOTCD" != "1" ] ; then
74 service swapmon restart
77 # Randomize pl_mop run time
78 M=$((60 * $RANDOM / 32768))
79 H=$((24 * $RANDOM / 32768))
80 sed -i -e "s/@M@/$M/" -e "s/@H@/$H/" %{_sysconfdir}/cron.d/pl_mom
85 # 0 = erase, 1 = upgrade
86 if [ "$1" -eq 0 ]; then
87 if [ "$PL_BOOTCD" != "1" ] ; then
91 chkconfig --del swapmon
97 %defattr(-, root, root, -)
98 %{_datadir}/%{name}/pl_mom.py*
99 %{_datadir}/%{name}/swapmon.py*
100 %{_initrddir}/swapmon
102 %{_sysconfdir}/cron.d/pl_mom
105 * Wed Nov 19 2008 Faiyaz Ahmed <faiyaza@cs.princeton.edu> - Mom-2.2-7
106 - Kill processes in context rather than restarting it.
107 - * Fixes bug where reset processes lose connectivity.
109 * Tue Jul 29 2008 Faiyaz Ahmed <faiyaza@cs.princeton.edu> - Mom-2.2-6
110 - Update mop script to monitor relevant procs. Update swapmon to avoid corner case when slice is being built.
112 * Wed Jun 25 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - Mom-2.2-5
113 - specfile was screwed, release number was not incremented upon tagging
115 * Thu Apr 24 2008 Faiyaz Ahmed <faiyaza@cs.princeton.edu> - Mom-2.2-4
117 - * Send mail from hostname if conf file can't be found
118 - * Use MOM address in conf file insead of support address.
119 - * Use new Vserver. Start slices without INITSCRIPTS after kill so user can still log in.
122 * Wed Jul 19 2006 Faiyaz Ahmed <faiyaza@cs.princeton.edu> 0.4-7.planetlab
123 - swapmon: Added state info so same reset email does not keep getting
124 sent. If slice is already being killed, will wait for a timeout
125 before trying to kill again.
127 * Mon Jul 17 2006 Faiyaz Ahmed <faiyaza@cs.princeton.edu> 0.4-6.planetlab
128 - swapmon: Added state information per slice. Slices are now killed
129 after consuming more memory than the threshold more than twice.
130 Also fixed the slice restart issue where slices would be restarted
131 and repeated restart emails would be sent.
133 * Mon Jul 10 2006 Faiyaz Ahmed <faiyaza@cs.princeton.edu> 0.4-5.planetlab
134 - bwmon: Initialize default limits
136 * Mon Jul 10 2006 Faiyaz Ahmed <faiyaza@cs.princeton.edu> 0.4-4.planetlab
137 - bwmon: Use cached values if NM stops responding