On 12/21/2010 01:58 AM, [email protected] wrote:
> We reboot all of our hosts on a weekly basis.  I used to price myself in 
> keeping my boxes up as long as possible, but having spent years now 
> supporting mission-critical financial production applications, I'm on board 
> with the weekly reboots.  Lets you know early if some system or app change is 
> problematic.
> 
> Reboot is being done via a standard reboot command.
> 
> I've looked around for rc scripts that might address this issue, but haven't 
> found any.  Got any pointers?
> 
> Regarding the rc.local solution, a) I'd prefer to solve the problem, not just 
> address the symptoms, and b) elsewhere in this thread I've described the 
> roadblocks that we have to doing anything a system level.  Yep, that's right, 
> boys, we survive in the app developer layer within which we do not have root 
> on these boxes.  It's a tedious, time-consuming, frustrating, 
> productivity-killing endeavor to do just about anything you can't do yourself.
> 
> So....got any sample RC scripts, or command line params to nagios to make it 
> smart enough to know that the PID that is in it's PID file isn't an active 
> process?
> 

Depending on what system tools you've got installed, this should work
decently. Set variables to proper values and add it to the top of your
init script.

pid=$(cat $lockfile)
kill -0 $pid || rm -f $lockfile
nagiospid=$(pidof nagios | sed 's/.* //')
test $pid = $nagiospid || rm -f $lockfile

-- 
Andreas Ericsson                   [email protected]
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.

------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
Nagios-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue. 
::: Messages without supporting info will risk being sent to /dev/null

Reply via email to