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 %{plrelease}
18 #URL: http://cvs.planet-lab.org/cvs/pl_mom
19 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
21 # swapmon requires vps and vkill
22 Requires: util-vserver, util-vserver-python
23 # for bwlimit used in swapmon
24 Requires: plnode-utils
29 pl_mom is a suite of PlanetLab node monitoring tools.
31 swapmon is a swap monitoring daemon. Every 30 seconds, it checks
32 process memory usage. At 90% utilization, resets the slice that is
33 consuming the most physical memory. At 95% utilization, it reboots the
34 machine to avoid a crash.
36 pl_mop is a cron job that "fixes" various common problems with nodes
37 (dead services, ext3 corruption, zombie SSH sessions, etc.).
45 rm -rf $RPM_BUILD_ROOT
48 install -D -m 644 pl_mom.py $RPM_BUILD_ROOT/%{_datadir}/%{name}/pl_mom.py
50 # Bandwidth monitor (bwmon), run periodically
51 #install -D -m 755 bwmon.py $RPM_BUILD_ROOT/%{_datadir}/%{name}/bwmon.py
53 # Swap monitoring daemon (swapmon)
54 install -D -m 755 swapmon.py $RPM_BUILD_ROOT/%{_datadir}/%{name}/swapmon.py
55 install -D -m 755 swapmon.init $RPM_BUILD_ROOT/%{_initrddir}/swapmon
58 install -D -m 755 pl_mop.sh $RPM_BUILD_ROOT/usr/bin/pl_mop.sh
60 # Runs pl_mop and bwmon periodically
61 install -D -m 644 pl_mom.cron $RPM_BUILD_ROOT/%{_sysconfdir}/cron.d/pl_mom
64 rm -rf $RPM_BUILD_ROOT
67 if [ "$PL_BOOTCD" != "1" ] ; then
74 chkconfig --add swapmon
76 if [ "$PL_BOOTCD" != "1" ] ; then
77 service swapmon restart
80 # Randomize pl_mop run time
81 M=$((60 * $RANDOM / 32768))
82 H=$((24 * $RANDOM / 32768))
83 sed -i -e "s/@M@/$M/" -e "s/@H@/$H/" %{_sysconfdir}/cron.d/pl_mom
88 # 0 = erase, 1 = upgrade
89 if [ "$1" -eq 0 ]; then
90 if [ "$PL_BOOTCD" != "1" ] ; then
94 chkconfig --del swapmon
100 %defattr(-, root, root, -)
101 %{_datadir}/%{name}/pl_mom.py*
102 %{_datadir}/%{name}/swapmon.py*
103 %{_initrddir}/swapmon
105 %{_sysconfdir}/cron.d/pl_mom
108 * Thu Jul 19 2012 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - mom-2.3-5
109 - use bwlimit from plnode
111 * Tue May 10 2011 Scott Baker <smbaker@gmail.com> - Mom-2.3-4
112 - Avoid writing error messages to stdout that are due to errors
115 * Wed Apr 20 2011 Scott Baker <smbaker@gmail.com> - Mom-2.3-3
116 - Fix parsing of vps in swapmon, add swapmon error messages when unparseable
117 - lines encountered, add stuck rpm checking to pl_mop
119 * Sun Dec 13 2009 Daniel Hokka Zakrisson <daniel@hozac.com> - Mom-2.3-2
120 - Don't restart disabled services.
122 * Tue Apr 07 2009 Faiyaz Ahmed <faiyaza@cs.princeton.edu> - Mom-2.3-1
125 * Wed Jul 19 2006 Faiyaz Ahmed <faiyaza@cs.princeton.edu> 0.4-7.planetlab
126 - swapmon: Added state info so same reset email does not keep getting
127 sent. If slice is already being killed, will wait for a timeout
128 before trying to kill again.
130 * Mon Jul 17 2006 Faiyaz Ahmed <faiyaza@cs.princeton.edu> 0.4-6.planetlab
131 - swapmon: Added state information per slice. Slices are now killed
132 after consuming more memory than the threshold more than twice.
133 Also fixed the slice restart issue where slices would be restarted
134 and repeated restart emails would be sent.
136 * Mon Jul 10 2006 Faiyaz Ahmed <faiyaza@cs.princeton.edu> 0.4-5.planetlab
137 - bwmon: Initialize default limits
139 * Mon Jul 10 2006 Faiyaz Ahmed <faiyaza@cs.princeton.edu> 0.4-4.planetlab
140 - bwmon: Use cached values if NM stops responding