From: Thierry Parmentelat Date: Wed, 25 Jun 2008 18:39:47 +0000 (+0000) Subject: Tagging module Mom - Mom-2.2-5 X-Git-Tag: Mom-2.2-5^0 X-Git-Url: http://git.onelab.eu/?p=mom.git;a=commitdiff_plain;h=5dde180b04f1be4efccf413c0564fe658de4f93b;hp=cf4bdcc5c2ef2a3e9bc25f11a540dbcae0f2ee84 Tagging module Mom - Mom-2.2-5 specfile was screwed, release number was not incremented upon tagging --- diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 4a80642..0000000 --- a/LICENSE +++ /dev/null @@ -1,31 +0,0 @@ -Copyright 2008 Princeton University - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - -* Redistributions of source code must retain the above - copyright notice, this list of conditions and the - following disclaimer. - -* Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the - following disclaimer in the documentation and/or other - materials provided with the distribution. - -* Neither the name of the copyright holder nor the names of - its contributors may be used to endorse or promote - products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS -IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL PRINCETON -UNIVERSITY OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF -USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.txt b/README.txt index 5285387..6863776 100644 --- a/README.txt +++ b/README.txt @@ -1,3 +1,5 @@ +# Copyright...something. + Overview -------- @@ -17,6 +19,14 @@ of consumed swap space: alias +Building +--------- + +Rename the parent directory from pl_mom to pl_mom-0.2 (or whatever is +the appropriate version number listed in the Makefile). Then "make +rpm" should do it. + + Notes ------ diff --git a/pl_mom.py b/pl_mom.py index f058eb4..bcb77c4 100644 --- a/pl_mom.py +++ b/pl_mom.py @@ -23,8 +23,8 @@ except: print "Warning: Configuration file /etc/planetlab/plc_config.py not found" PLC_NAME = "PlanetLab" PLC_SLICE_PREFIX = "pl" - PLC_MAIL_SUPPORT_ADDRESS = "support@planet-lab.org" - PLC_MAIL_SLICE_ADDRESS = "SLICE@slices.planet-lab.org" + PLC_MAIL_SUPPORT_ADDRESS = "root@" + socket.gethostname() + PLC_MAIL_SLICE_ADDRESS = "SLICE@" + socket.gethostname() def format_bytes(bytes, si = True): """ diff --git a/pl_mom.spec b/pl_mom.spec index bf3fcac..cbd47b1 100644 --- a/pl_mom.spec +++ b/pl_mom.spec @@ -1,14 +1,9 @@ -# -# $Id$ -# -%define url $URL$ - %define name pl_mom %define version 2.2 %define taglevel 5 %define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}} - + Summary: PlanetLab node monitoring tools Name: %{name} Version: %{version} @@ -18,9 +13,8 @@ Group: System Environment/Kernel Source: %{name}-%{version}.tgz Vendor: PlanetLab Packager: PlanetLab Central -Distribution: PlanetLab %{plrelease} -URL: %(echo %{url} | cut -d ' ' -f 2) -#URL: http://cvs.planet-lab.org/cvs/pl_mom +Distribution: PlanetLab 3.0 +URL: http://cvs.planet-lab.org/cvs/pl_mom BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires: expect # swapmon requires vps and bwlimit.py @@ -108,6 +102,16 @@ exit 0 %{_sysconfdir}/cron.d/pl_mom %changelog +* Wed Jun 25 2008 Thierry Parmentelat - Mom-2.2-5 +- specfile was screwed, release number was not incremented upon tagging + +* Thu Apr 24 2008 Faiyaz Ahmed - Mom-2.2-4 +- +- * Send mail from hostname if conf file can't be found +- * Use MOM address in conf file insead of support address. +- * Use new Vserver. Start slices without INITSCRIPTS after kill so user can still log in. +- + * Wed Jul 19 2006 Faiyaz Ahmed 0.4-7.planetlab - swapmon: Added state info so same reset email does not keep getting sent. If slice is already being killed, will wait for a timeout diff --git a/pl_mop.sh b/pl_mop.sh index 97dad39..0a512c0 100755 --- a/pl_mop.sh +++ b/pl_mop.sh @@ -206,7 +206,7 @@ kill_nm_inslice(){ line=$(vps aux | grep $pid) echo NM found in slice. Killing PID $pid echo $line - vkill -9 $pid + kill -9 $pid done } diff --git a/swapmon.py b/swapmon.py index 7ca19bc..b25d57f 100755 --- a/swapmon.py +++ b/swapmon.py @@ -198,6 +198,9 @@ class Reset: print "Slice %s is being killed." % self.name vserver = VServer(self.name) vserver.stop() + # ignore initscripts. Don't run anything at start. + vserver.INITSCRIPTS = [] + vserver.start() os._exit(0) else: os.waitpid(pid,0) @@ -235,7 +238,7 @@ class Reset: print "Resetting slice " + self.name vserver = VServer(self.name) vserver.stop() - vserver.start(wait = False) + vserver.start() os._exit(0) else: os.waitpid(pid,0) @@ -269,10 +272,10 @@ def slicestat(names = None): """ Get status of specified slices (if names is None or empty, all slices). vsize, sz, and rss are in KiB. Returns - + PID CONTEXT VSZ SZ RSS %MEM CMD {xid: {'xid': slice_id, 'name': slice_name, - 'procs': [{'pid': pid, 'xid': slice_id, 'user', username, 'cmd': command, + 'procs': [{'pid': pid, 'xid': slice_id, 'cmd': command, 'vsize': virtual_kib, 'sz': potential_kib, 'rss': physical_kib, 'pcpu': cpu_percent, 'pmem': mem_percent}] 'vsize': total_virtual_kib, @@ -283,7 +286,7 @@ def slicestat(names = None): # Mandatory fields. xid is a virtual field inserted by vps. Make # sure cmd is last so that it does not get truncated # automatically. - fields = ['pid', 'xid', 'user', 'vsize', 'sz', 'rss', 'pcpu', 'pmem', 'cmd'] + fields = ['pid', 'xid', 'vsize', 'sz', 'rss', 'pmem', 'cmd'] # vps inserts xid after pid in the output, but ps doesn't know # what the field means. @@ -295,7 +298,7 @@ def slicestat(names = None): # Eat the header line. vps depends on the header to figure out # which column is the PID column, so we can't just tell ps not to # print it. - for line in bwlimit.run("/usr/sbin/vps -e -o " + ",".join(ps_fields))[1:]: + for line in bwlimit.run("/usr/sbin/vps -e -o " + ":16,".join(ps_fields))[1:]: # Chomp newline line = line.strip() @@ -320,14 +323,16 @@ def slicestat(names = None): except ValueError: pass - # vps sometimes prints ERR instead of a context ID if it + # vps sometimes prints ERR or the name of the slice + # instead of a context ID if it # cannot identify the context of an orphaned (usually dying) # process. Skip these processes. - if type(proc['xid']) != int: + if (type(proc['xid']) != int) or (type(proc['vsize']) !=int): continue # Assign (pl_)sshd processes to slice instead of root m = re.search(r"sshd: ([a-zA-Z_]+)", proc['cmd']) + if m is not None: xid = bwlimit.get_xid(m.group(1)) if xid is not None: @@ -365,7 +370,7 @@ def slicestat(names = None): slice['rss'] += proc['rss'] slices[proc['xid']] = slice - + return slices def memtotal(): @@ -439,12 +444,11 @@ def formtable(slice, percent): table = "%5s %10s %10s %10s %4s %4s %s\n\n" % \ ("PID", "VIRT", "SZ", "RES", '%CPU', '%MEM', 'COMMAND') for proc in slice['procs']: - table += "%5s %10s %10s %10s %4.1f %4.1f %s\n" % \ + table += "%5s %10s %10s %10s %4.1f %s\n" % \ (proc['pid'], format_bytes(proc['vsize'] * 1024, si = False), format_bytes(proc['sz'] * 1024, si = False), format_bytes(proc['rss'] * 1024, si = False), - proc['pcpu'], proc['pmem'], proc['cmd']) @@ -584,8 +588,6 @@ def main(): if resetlist[resetslice].killtimeleft == 0 and \ resetlist[resetslice].resettimeleft == 0: del resetlist[resetslice] - - if verbose: print "%d%% swap consumed" % used if used >= reboot_thresh: # Dump slice state before rebooting