Nagios kept from restarting after reboot by lock file

Andreas Ericsson ae at op5.se
Tue Dec 21 08:45:22 CET 2010


On 12/21/2010 01:54 AM, eric.berg at barclayscapital.com wrote:
> If you had any idea how difficult it is just to do the most basic
> system administration tasks in the environment within which we're
> working, you'd be shaking your head in empathetic embarassment.
> Filling out tickets and -- get this: our company has an official
> state for our tickets referred to as "Chasing", which is when, after
> entering your ticket into this multi-million dollar ticket tracking
> system, you then have to manually pick up the phone, email, or walk
> over to bug the guy who should now act on the ticket.  It's a
> nightmare.  I built it.
> 

Sounds unpleasant, inefficient and costly.

> That was intended to express the irony of my search for a solution to
> keep my monitoring system up.  I'm shocked that nagios can't tell the
> difference between a pid file that refers to a running process and
> one that refers to one that's not running any more.

It can, but it's damn near impossible to do portably from a script, and
hard enough to do from C. It's easy enough to check that *some* sort of
process is running with the pid in the lockfile, but in order to do it
correct, one should also check that it's a Nagios process, and that's
the hard part.

The quick workaround is to add a boot script that runs before the
Nagios startup script and unconditionally removes the lockfile. That's
not a universal solution though, since the lockfile will remain if
Nagios crashes.

>  It's the first
> thing about Nagios that's got my head scractching...besides the
> complex set of dependencies that you have to negotiate to do pretty
> much anything.
> 

Well, there are plenty of tools to help with configuration and such.
Nacoma is one of them. Nagiosql is another.

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
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
Nagios-users at lists.sourceforge.net
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





More information about the Users mailing list