3 %define release 11%{?pldistro:.%{pldistro}}%{?date:.%{date}}
5 Summary: PlanetLab node monitoring tools
10 Group: System Environment/Kernel
11 Source: %{name}-%{version}.tgz
13 Packager: PlanetLab Central <support@planet-lab.org>
14 Distribution: PlanetLab 3.0
15 URL: http://cvs.planet-lab.org/cvs/pl_mom
16 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
18 # swapmon requires vps and bwlimit.py
19 Requires: util-vserver, util-vserver-python
24 pl_mom is a suite of PlanetLab node monitoring tools.
26 swapmon is a swap monitoring daemon. Every 30 seconds, it checks
27 process memory usage. At 90% utilization, resets the slice that is
28 consuming the most physical memory. At 95% utilization, it reboots the
29 machine to avoid a crash.
31 bwmon is a cron job that monitors the average bandwidth usage of each
32 slice and enforces a daily byte limit for each slice.
34 pl_mop is a cron job that "fixes" various common problems with nodes
35 (dead services, ext3 corruption, zombie SSH sessions, etc.).
43 rm -rf $RPM_BUILD_ROOT
46 install -D -m 644 pl_mom.py $RPM_BUILD_ROOT/%{_datadir}/%{name}/pl_mom.py
48 # Bandwidth monitor (bwmon), run periodically
49 install -D -m 755 bwmon.py $RPM_BUILD_ROOT/%{_datadir}/%{name}/bwmon.py
51 # Swap monitoring daemon (swapmon)
52 install -D -m 755 swapmon.py $RPM_BUILD_ROOT/%{_datadir}/%{name}/swapmon.py
53 install -D -m 755 swapmon.init $RPM_BUILD_ROOT/%{_initrddir}/swapmon
56 install -D -m 755 pl_mop.sh $RPM_BUILD_ROOT/usr/local/planetlab/bin/pl_mop.sh
58 # Tests and restarts NM
59 install -D -m 755 nm_mom.py $RPM_BUILD_ROOT/%{_datadir}/%{name}/nm_mom.py
61 # Runs pl_mop and bwmon periodically
62 install -D -m 644 pl_mom.cron $RPM_BUILD_ROOT/%{_sysconfdir}/cron.d/pl_mom
65 rm -rf $RPM_BUILD_ROOT
68 if [ "$PL_BOOTCD" != "1" ] ; then
75 chkconfig --add swapmon
77 if [ "$PL_BOOTCD" != "1" ] ; then
78 service swapmon restart
81 # Randomize pl_mop run time
82 M=$((60 * $RANDOM / 32768))
83 H=$((24 * $RANDOM / 32768))
84 sed -i -e "s/@M@/$M/" -e "s/@H@/$H/" %{_sysconfdir}/cron.d/pl_mom
89 # 0 = erase, 1 = upgrade
90 if [ "$1" -eq 0 ]; then
91 if [ "$PL_BOOTCD" != "1" ] ; then
95 chkconfig --del swapmon
101 %defattr(-, root, root, -)
102 %{_datadir}/%{name}/pl_mom.py
103 %{_datadir}/%{name}/nm_mom.py
104 %{_datadir}/%{name}/bwmon.py
105 %{_datadir}/%{name}/swapmon.py
106 %{_initrddir}/swapmon
107 /usr/local/planetlab/bin/pl_mop.sh
108 %{_sysconfdir}/cron.d/pl_mom
111 * Wed Jul 19 2006 Faiyaz Ahmed <faiyaza@cs.princeton.edu> 0.4-7.planetlab
112 - swapmon: Added state info so same reset email does not keep getting
113 sent. If slice is already being killed, will wait for a timeout
114 before trying to kill again.
116 * Mon Jul 17 2006 Faiyaz Ahmed <faiyaza@cs.princeton.edu> 0.4-6.planetlab
117 - swapmon: Added state information per slice. Slices are now killed
118 after consuming more memory than the threshold more than twice.
119 Also fixed the slice restart issue where slices would be restarted
120 and repeated restart emails would be sent.
122 * Mon Jul 10 2006 Faiyaz Ahmed <faiyaza@cs.princeton.edu> 0.4-5.planetlab
123 - bwmon: Initialize default limits
125 * Mon Jul 10 2006 Faiyaz Ahmed <faiyaza@cs.princeton.edu> 0.4-4.planetlab
126 - bwmon: Use cached values if NM stops responding