Nagios plugin?

Justin H. Brehm jbrehm at icontact.com
Wed May 7 19:20:19 UTC 2008


Database has to be checked because there are instances (testing only fortunately) when we could lose the db and MogileFS::Backend will keep trying to connect either causing an NRPE plugin timeout or and exit code of '82' which Nagios would read as an 'UNKNOWN'. Mogile is doing exactly what it was supposed to be doing, but sometimes that doesn't work for Nagios plugins and I needed to find a way to "short circuit" the check for these cases. :) 

I do also monitor DB separately, but if this catches something earlier, then I'd want to know. 

Yeah, I was just using the config because I felt that's something everyone would have on their setup. Just something quick that came to mind, but dumping in a garbage file is definitely something that can be added and much more secure. 

It is using a new key each time. Sorry about not commenting up that part, but I'm adding the hostname and a timestamp onto the key each time. It's also deleting the key right after we do the comparison in the 'cleanup' function. 

--Justin 

----- Original Message ----- 
From: "Mark Smith" <smitty at gmail.com> 
To: "Justin Brehm" <jbrehm at icontact.com> 
Cc: "Frieder Kundel" <frieder.kundel at gmail.com>, mogilefs at lists.danga.com 
Sent: Wednesday, May 7, 2008 3:00:05 PM (GMT-0500) America/New_York 
Subject: Re: Nagios plugin? 

> Alright, here's what I have. 

Why do you check the database? You don't seem to do anything with 
this data. I don't know that you need to check it anyway because 
that's sort of implied by checking MogileFS - if you can't insert/get 
files, then something is broken. (And you should monitor the database 
separately anyway, IMO.) 

Also, I would suggest using something other than the config file. You 
can just generate raw content yourself, maybe 1000 bytes of random 
noise. Then you're not dependent on this file existing on the machine 
that is doing the Nagios check. 

Third point, use a different key, include the pid or the time or 
something, so that you can be sure you have a valid check from start 
to finish. (And then have something that cleans out those files after 
some time?) 


-- 
Mark Smith / xb95 
smitty at gmail.com 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.danga.com/pipermail/mogilefs/attachments/20080507/39145762/attachment.html 


More information about the mogilefs mailing list