<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jan 8, 2010, at 2:55 PM, gmartin wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Israel, <br>I believe you are correct. I'll be interested to hear what other shave to say on the inner workings. In the meantime, can the problem be solved if the event handler for Service B is written to restart svc A if it is down? (perhaps it calls the same nagios check from the command line and acts on the results)<br></blockquote><div><br></div><div>Yeah, that should work, at least for my specific situation. Of course, doing so greatly reduces the utility of having the dependancy in the first place, since the situations under which it would be triggered (given nagios restarting service A as soon as it detects it as down) would be somewhat rare, and even when triggered it would no longer be needed, since the service B event handler does its own dependancy checking. </div><div><br></div><div>The only time the dependancy would apply (assuming our understanding is right) is in the situation where Nagios detects A as down, and then tries to run a check on B before verifying that A is back up. Of course, even then it wouldn't matter, since a) nagios should have restarted service A immediately (so a straight restart of B would be fine), and b) even if nagios didn't, the new event handler for service B would. At which point there is no need of the dependancy at all, since the event handler takes care of the dependancies. Basically, if the dependancy only applies when nagios ALREADY knows service A is down, then the dependancy is basically useless, at least in this situation. Of course, if this is just the way dependancies work, then there may be no other option. Thanks for the feedback.</div><br><blockquote type="cite"> <br clear="all">\\Greg<br><br> <br><br><div class="gmail_quote">On Fri, Jan 8, 2010 at 6:07 PM, Israel Brewster <span dir="ltr"><<a href="mailto:israel@frontierflying.com">israel@frontierflying.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> <div style="word-wrap: break-word;">Here's the situation: running nagios 3.2.0, I have two services, we'll call them A and B. Both have event handlers such that if they register a hard critical state, Nagios attempts to restart them. Service B depends on service A, such that when service A goes down, service B does as well, causing them both to need restarted, with A needing to be restarted first. I have a servicedependancy set up in nagios specifying service B's dependancy on service A.<div> <br></div><div>My understanding is that the way this works is that when nagios goes to check service B, it first looks at the "current" state (as defined by the last nagios check) of service A, and, if the execution_failure_criteria matches (i.e. if service A is down) nagios does not run the check on service B, thus not running the event handler to attempt to restart B until A is back up. This is good. But what happens in the following scenario?</div> <div><br></div><div>Service A is scheduled to check every 5 minutes.</div><div>1) Nagios does a normally scheduled check of service A, finding it to be OK.</div><div>2) One minute later, Service A crashes</div><div>3) One minute after that (three minutes prior to the next regular check of service A), thanks to nagios staggering checks, Nagios goes to do a normal check of service B</div> <div><br></div><div>Now, to my understanding of this scenario, the check on service B would run normally, since the last check on A was OK, and nagios uses cached results for dependancy checks. Since service A is actually critical, service B will be critical as well. The problem with this is that Nagios will respond by attempting to restart service B, which will invariably fail since service A is still down. Once the next regular check time for service A is reached, Nagios will detect service A as down and restart it, but service B will never get restarted successfully, since nagios already tried and failed. </div> <div><br></div><div>Is this correct? If so, what can be done about it? Or is nagios smart enough to schedule its service checks to avoid this scenario? It seems that the most logical solution (if possible) would be to mirror the service/host check logic. That is, when a check of service B comes back as critical, immediately check service A. If service A is critical, then don't declare service B to be critical until service A is OK, at which point B would enter a hard down state and run the event handler. Alternately, if I could say something like always check service A immediately before checking service B to make sure our data is current, that would work as well. Although I could see it resulting in excessive checking of service A, which may be less desirable. What do you guys think? <br> <div> <span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span style="font-family: 'Times New Roman',fantasy; font-size: 16px;"><span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span style="font-family: Helvetica,sans-serif; font-size: 12px;"><div> <div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman',serif;"><span style="font-size: 9pt; font-family: Helvetica,sans-serif; color: black;">-----------------------------------------------</span></div> </div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman',serif;"><span style="font-size: 9pt; font-family: Helvetica,sans-serif; color: black;">Israel Brewster</span></div></div> <font color="#888888"><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman',serif;"><span style="font-size: 9pt; font-family: Helvetica,sans-serif; color: black;">Computer Support Technician II</span></div> </div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman',serif;"><span style="font-size: 9pt; font-family: Helvetica,sans-serif; color: black;">Frontier Flying Service Inc.</span></div> </div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman',serif;"><span style="font-size: 9pt; font-family: Helvetica,sans-serif; color: black;">5245 Airport Industrial Rd</span></div> </div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman',serif;"><span style="font-size: 9pt; font-family: Helvetica,sans-serif; color: black;">Fairbanks, AK 99709</span></div> </div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman',serif;"><span style="font-size: 9pt; font-family: Helvetica,sans-serif; color: black;">(907) 450-7250 x293</span></div> </div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman',serif;"><span style="font-size: 9pt; font-family: Helvetica,sans-serif; color: black;">-----------------------------------------------</span></div> <div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman',serif;"><span style="font-size: 9pt; font-family: Helvetica,sans-serif; color: black;"><span style="font-family: Helvetica; font-size: medium;"></span></span><span></span><br> <span></span></div></div></font></div></span></span></span></span></div></div></div><br><div style="word-wrap: break-word;"><div><div><span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span style="font-family: 'Times New Roman',fantasy; font-size: 16px;"><span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span style="font-family: Helvetica,sans-serif; font-size: 12px;"><div> <div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman',serif;"><span></span> </div></div></div></span></span></span></span></div><br></div></div><br>------------------------------------------------------------------------------<br> This SF.Net email is sponsored by the Verizon Developer Community<br> Take advantage of Verizon's best-in-class app development support<br> A streamlined, 14 day to market process makes app distribution fast and easy<br> Join now and get one step closer to millions of Verizon customers<br> <a href="http://p.sf.net/sfu/verizon-dev2dev" target="_blank">http://p.sf.net/sfu/verizon-dev2dev</a> <br>_______________________________________________<br> Nagios-users mailing list<br> <a href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</a><br> <a href="https://lists.sourceforge.net/lists/listinfo/nagios-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-users</a><br> ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.<br> ::: Messages without supporting info will risk being sent to /dev/null<br></blockquote></div><br></blockquote></div><br><div> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="font-family: 'Times New Roman', fantasy; font-size: 16px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="font-family: Helvetica, sans-serif; font-size: 12px; "><div><div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 9pt; font-family: Helvetica, sans-serif; color: black; ">-----------------------------------------------<o:p></o:p></span></div></div><div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 9pt; font-family: Helvetica, sans-serif; color: black; ">Israel Brewster<o:p></o:p></span></div></div><div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 9pt; font-family: Helvetica, sans-serif; color: black; ">Computer Support Technician II<o:p></o:p></span></div></div><div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 9pt; font-family: Helvetica, sans-serif; color: black; ">Frontier Flying Service Inc.<o:p></o:p></span></div></div><div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 9pt; font-family: Helvetica, sans-serif; color: black; ">5245 Airport Industrial Rd<o:p></o:p></span></div></div><div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 9pt; font-family: Helvetica, sans-serif; color: black; ">Fairbanks, AK 99709<o:p></o:p></span></div></div><div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 9pt; font-family: Helvetica, sans-serif; color: black; ">(907) 450-7250 x293<o:p></o:p></span></div></div><div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 9pt; font-family: Helvetica, sans-serif; color: black; ">-----------------------------------------------</span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 9pt; font-family: Helvetica, sans-serif; color: black; "><span class="Apple-style-span" style="font-family: Helvetica; font-size: medium; "></span></span><span></span><br class="Apple-interchange-newline"><span></span></div></div></div></span></span></span></span></div></body></html>