[PATCH] notifications: Fix first_notification_delay

Jochen Bern Jochen.Bern at LINworks.de
Wed Dec 12 20:10:45 CET 2012


On 11.12.2012 22:56, Jim Avery wrote:
> We want to send an SMS notification if the UPS goes on to battery, but only
> if it has been on battery for more than, say, five minutes.  I had hoped
> that first_notification_delay would give me that possibility.  Obviously as
> this is a passive check [...]
> 
> Please forgive me that I don't understand the programmatical issues well
> enough to see if any of the proposed solutions so far will fit this use
> case.

I'ld say that our discussion is perpendicular to the issue you raise -
or, in other words, that first_notification_delay is unlikely to
suddenly work the way you want afterwards.

You see, while everyone just calls it "passive checks", the terminology
in the web UI - "active checks disabled" - is more correct. (Yes, a
service *could* have active *and* passive check results going into it.
I've just never seen a working setup doing that, or a use case seriously
asking for it.) Using "passive checks" means that Nagios can forget
about scheduling commands for that service, ever; waiting for events and
reacting to them is all that's required.

Asking that Nagios now *should* schedule a notification being sent
first_notification_delay after receiving a non-OK passive result sort of
negates the entire concept.

What I'ld try in your place is to write the (last) trap into a cache
file, and then run an *active* check looking for the reported state *and
timestamp*, possibly differentiating WARNING/CRITICAL based on the latter.

(Note to others: Actively checking the UPS' *current* state directly
could yield false positives *if* the UPS / power keeps flapping and the
active checks just *happen* to see only the on-battery state for a
couple times in a row.)

Regards,
								J. Bern
-- 
*NEU* - NEC IT-Infrastruktur-Produkte im <http://www.linworks-shop.de/>:
Server--Storage--Virtualisierung--Management SW--Passion for Performance
Jochen Bern, Systemingenieur --- LINworks GmbH <http://www.LINworks.de/>
Postfach 100121, 64201 Darmstadt | Robert-Koch-Str. 9, 64331 Weiterstadt
PGP (1024D/4096g) FP = D18B 41B1 16C0 11BA 7F8C DCF7 E1D5 FAF4 444E 1C27
Tel. +49 6151 9067-231, Zentr. -0, Fax -299 - Amtsg. Darmstadt HRB 85202
Unternehmenssitz Weiterstadt, Geschäftsführer Metin Dogan, Oliver Michel

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d




More information about the Developers mailing list