Unneeded any longer.
Faiyaz Ahmed [Tue, 27 Feb 2007 23:09:06 +0000 (23:09 +0000)]
nm_mom.py [deleted file]
pl_mom.cron
pl_mom.spec

diff --git a/nm_mom.py b/nm_mom.py
deleted file mode 100755 (executable)
index dc18817..0000000
--- a/nm_mom.py
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/usr/bin/python
-# 
-# Restarts NM if NM does not respond to periodic probes.
-#
-# Faiyaz Ahmed <faiyaza@cs.princeton.edu>
-# Copyright (C) 2006 The Trustees of Princeton University
-#
-# $Id: nm_mom.py,v 1.2 2006/08/17 20:12:09 faiyaza Exp $
-# 
-
-import syslog
-import os
-import sys
-import time
-
-import socket
-import xmlrpclib
-import bwlimit
-
-from sets import Set
-
-# Utility functions
-from pl_mom import *
-
-
-def restartNM():
-       try:
-               pid = os.fork()
-                if pid == 0:
-                       bwlimit.run("/etc/init.d/pl_nm stop")
-                       time.sleep(10)
-                       try:
-                               nmpid = bwlimit.run("/bin/ps -e -o pid,cmd | grep nm.py")[0].split(" ")[0]
-                               os.kill(int(nmpid), 9)
-                               time.sleep(3)
-                               print "NM  %s forcefully killed." %nmpid
-                       except:
-                               print "NM %s killed." %nmpid
-                       bwlimit.run("/etc/init.d/pl_nm restart")
-                       print "NM restarted."
-                       os._exit(0)
-                else:
-                        os.waitpid(pid,0)
-        except Exception, err:
-                print "Warning: Exception received while restarting NM:  %s" % err
-
-
-def main():
-        syslog.openlog("nm_mom")
-        sys.stdout = sys.stderr = Logger()
-       
-       nm = NM()
-       last_maxrate = 0 
-       try:
-               # Query something.  If it doesnt come back...
-                vals = nm.query("pl_netflow", [('nm_net_max_rate', last_maxrate)])
-
-        except Exception, err:
-                print "Warning: Exception received while querying NM:", err
-               restartNM()
-
-if __name__ == '__main__':
-    main()
index 4ab6411..3d439af 100644 (file)
@@ -4,9 +4,7 @@
 # Mark Huang <mlhuang@cs.princeton.edu>
 # Copyright (C) 2005 The Trustees of Princeton University
 #
-# $Id: pl_mom.cron,v 1.3 2006/10/11 16:14:10 faiyaza Exp $
+# $Id: pl_mom.cron,v 1.4 2007/02/14 19:24:06 faiyaza Exp $
 #
 
 @M@    @H@     * *     *       root    /usr/local/planetlab/bin/pl_mop.sh
-#*/15 *  * * * root    /usr/share/pl_mom/bwmon.py
-#*    12 * * * root    /usr/share/pl_mom/nm_mom.py
index ead3360..eb1f2b1 100644 (file)
@@ -52,9 +52,6 @@ install -D -m 755 swapmon.init $RPM_BUILD_ROOT/%{_initrddir}/swapmon
 # Cleanup script
 install -D -m 755 pl_mop.sh $RPM_BUILD_ROOT/usr/local/planetlab/bin/pl_mop.sh
 
-# Tests and restarts NM
-#install -D -m 755 nm_mom.py $RPM_BUILD_ROOT/%{_datadir}/%{name}/nm_mom.py
-
 # Runs pl_mop and bwmon periodically
 install -D -m 644 pl_mom.cron $RPM_BUILD_ROOT/%{_sysconfdir}/cron.d/pl_mom
 
@@ -97,8 +94,6 @@ exit 0
 %files
 %defattr(-, root, root, -)
 %{_datadir}/%{name}/pl_mom.py*
-#%{_datadir}/%{name}/nm_mom.py*
-#%{_datadir}/%{name}/bwmon.py*
 %{_datadir}/%{name}/swapmon.py*
 %{_initrddir}/swapmon
 /usr/local/planetlab/bin/pl_mop.sh