Title: [opsview] [9607] Change test for checking nagios shut down
- Revision
- 9607
- Author
- dferguson
- Date
- 2012-07-23 15:16:47 +0100 (Mon, 23 Jul 2012)
Log Message
Change test for checking nagios shut down
Modified Paths
Modified: trunk/opsview-core/utils/reschedule_checks
===================================================================
--- trunk/opsview-core/utils/reschedule_checks 2012-07-23 12:29:36 UTC (rev 9606)
+++ trunk/opsview-core/utils/reschedule_checks 2012-07-23 14:16:47 UTC (rev 9607)
@@ -1,6 +1,6 @@
-#!/bin/bash
+#!/bin/bash -x
-# Copyright (C) 2003-2012 Opsview Limited. All rights reserved
+# Copyright (C) 2003-2011 Opsera Limited. All rights reserved
#
# This is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -17,10 +17,10 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# stop nagios, amend retention.dat to remove last/next check times,
-# restart nagios to reschedule everything in a balanced manner
+# restart nagios to rescheudle everything in a balanced manner
echo "$(date): Starting"
-echo "$(date): Shutting down Nagios"
+echo "$(date): Shutting down Nagios on $(hostname)"
/usr/local/nagios/bin/rc.opsview stop
@@ -29,7 +29,8 @@
inner_count_total=6
inner_count=$inner_count_total
outter_count=3
-while [ -e $pipe ]; do
+sleep 5
+while /usr/local/nagios/bin/rc.opsview status; do
sleep 5
echo "$(date): Waiting on pipe removal: inner_count=$inner_count outter_count=$outter_count"
@@ -49,6 +50,8 @@
echo "$(date): Nagios stopped; continuing"
+rm -f $pipe
+
perl -n -i.bak -e 'print unless(m/(?:last|next)_check=/);' /usr/local/nagios/var/retention.dat
echo "$(date): Starting Nagios"
_______________________________________________
Opsview-checkins mailing list
[email protected]
http://lists.opsview.org/lists/listinfo/opsview-checkins