Simulating downtime in nagios

Kelly Jones kelly.terry.jones at gmail.com
Tue Oct 7 03:57:06 CEST 2008


Thanks, Tom.

Yes, I'm trying to simulate a host/service outage, not scheduled downtime.

The problem w/ submitting a passive check is that the next ACTIVE
check will invalidate it. Example: you tell nagios that machine foo is
down. That's soft alert 1, not enough to generate any emails. Nagios
then active checks foo and sees that it's up. Of course, you can
submit another passive check, but you'll ping-pong (flap) between up
and down states.

-- 
We're just a Bunch Of Regular Guys, a collective group that's trying
to understand and assimilate technology. We feel that resistance to
new ideas and technology is unwise and ultimately futile.

On 10/6/08, Tom Throckmorton <throck at gmail.com> wrote:
> On Oct 06 12:29, Kelly Jones wrote:
>> What's the best way to simulate (not schedule) downtime in nagios?
>>
>> I want to "pretend" a service is down for a certain amount of time to
>> see what alerts nagios sends, etc.
>
> Just to clarify, are you trying to simulate a service outage (as opposed to
> simulating a scheduled downtime) so you can test alerts, and perhaps
> notifications, in order to validate your configuration?
>
>> I've come up w/ two bad ways to do this:
>>
>>  % Edit the config file to change the test to "check_dummy". I want to
>>  run these "fire drills" via cron, and editing a file and restarting
>>  nagios seems a little ugly.
>>
>>  % Submit a passive check saying the service is down, and reschedule
>>  the next check 4 hours later, so the service is 'down' for 4
>>  hours. This can be done using the nagios named pipe, so it's easy to
>>  cron.  Problem: doing things this way suppresses the alerts (when you
>>  don't test a service, it doesn't send an alert).
>>
>> Thoughts?
>
> I use something similar to the second method to do ad hoc validation of
> alerts/notifications, by submitting passive results via an external command,
> though without diddling the service check scheduling.  I'm a little confused
> by
> your last statement though...
>
> If you're only submitting a single passive check and then rescheduling the
> next
> check, of course there will be no alerts (and you'll likely never reach
> $max_check_attempts) - is there some reason you can't submit multiple
> passive
> check results?
>
> -tt

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
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