Using passive host checks and freshness
Kevin Keane
subscription at kkeane.com
Sun Jun 21 07:32:05 CEST 2009
I am using Nagios 3.0.6. In my setup, most checks are passive. I also am
using passive host checks. I can't get freshness checking to work right
for host checks, though it works fine for services. I'd appreciate some
help with that!
I tried configuring the host checks the same way as service checks:
active_checks_enabled 0
passive_checks_enabled 1
check_freshness 1
freshness_threshold 900
check_command check_dummy!2!"Server is down!"
But freshness checking apparently is never taking place.
When I set active_checks_enabled to 1, Nagios will change the status to
UP when a check result arrives for the host, and then immediately,
within ten seconds or less, change it back to DOWN. Oddly enough, it
does not use the status text return from check_dummy ("Server is down!")
but rather (null).
The relevant host and template definitions are attached below, as well
as an excerpt from the nagios.log file for the same server.
define host {
host_name xxxx.xxxx.xxxx
hostgroups servers
alias XXXXX
address 192.168.2.197
use windows-server
contact_groups mainoffice
}
define host{
name windows-server ; The name of this host
template
use generic-host ; Inherit default values
from the generic-host template
check_period 24x7 ; By default, Windows
servers are monitored round the clock
check_interval 5 ; Actively check the
server every 5 minutes
retry_interval 1 ; Schedule host check
retries at 1 minute intervals
max_check_attempts 10 ; Check each server 10
times (max)
# check_command check-host-alive ; Default
command to check if servers are "alive"
passive_checks_enabled 1
check_freshness 1
freshness_threshold 900
check_command check_dummy!2!"Server is down!"
# normal_check_interval 5
# retry_check_interval 2
notification_period 24x7 ; Send notification out
at any time - day or night
notification_interval 30 ; Resend notifications
every 30 minutes
notification_options d,r ; Only send
notifications for specific host states
contact_groups admins ; Notifications get sent
to the admins by default
hostgroups windows-servers ; Host groups that
Windows servers should be a member of
register 0 ; DONT REGISTER THIS -
ITS JUST A TEMPLATE
}
The Nagios.log file contains:
[1245555922] PASSIVE HOST CHECK: xxxx.xxxx.xxxx;0;sometext
[1245555922] HOST ALERT: xxxx.xxxx.xxxx;UP;HARD;1;sometext
[1245555922] HOST NOTIFICATION:
xxx at xxx.com;xxxx.xxxx.xxxx;UP;notify-host-by-email;sometext
[1245555930] HOST NOTIFICATION:
kkeane;xxxx.xxxx.xxxx;UP;notify-host-by-email;sometext
[1245555931] HOST ALERT: xxxx.xxxx.xxxx;DOWN;SOFT;1;(null)
--
Kevin Keane
Owner
The NetTech
Find the Uncommon: Expert Solutions for a Network You Never Have to Think About
Office: 866-642-7116
http://www.4nettech.com
This e-mail and attachments, if any, may contain confidential and/or proprietary information. Please be advised that the unauthorized use or disclosure of the information is strictly prohibited. The information herein is intended only for use by the intended recipient(s) named above. If you have received this transmission in error, please notify the sender immediately and permanently delete the e-mail and any copies, printouts or attachments thereof.
------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
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