Page 1 of 1

passive host check from client

Posted: Tue Feb 23, 2016 2:56 am
by bmh
Hi Guy's.

I have a problem that are driving me insane....almost :)

I've have a passive check that are deployed on clients, that sends a OK to server every 20 min.
I can also see that the check is logged af the server "EXTERNAL COMMAND: PROCESS_HOST_CHECK_RESULT;bmhtest;0;OK, PASSIVE HOST CHECK: bmhtest;0;OK" so fare so good.
Now im trying to get the server to check freshness of the passive host check, so that if the check from the client is older then 30 min, then give me some form of alarm, but i can't get that part in place.
If i close down the clinet, so that the check will not be sent, nothing is happening on the server, i don't see it in that log, and i would expect a "Host is unreachable" or something.

I have enabled the following in nagios.cfg
accept_passive_host_checks=1
translate_passive_host_checks=1
check_host_freshness=1
host_freshness_check_interval=1500

Do i miss something or ?
I would love for someone to say..."you're a noob, you have to do this ans this in order to get it to work :D "

Re: passive host check from client

Posted: Tue Feb 23, 2016 10:44 am
by rkennedy
Can you post your related host / service definition for us to look at?

Re: passive host check from client

Posted: Wed Feb 24, 2016 1:43 am
by bmh
Sure rkennedy.

The answer have been i front of me the whole time
I managed to get it working, here a copy.

hosts.cfg
define host {
name linux-host
event_handler_enabled 1
flap_detection_enabled 1
failure_prediction_enabled 1
process_perf_data 1
retain_status_information 1
retain_nonstatus_information 1

check_period 24x7
check_interval 15
check_command host-report-down
retry_interval 1
max_check_attempts 1

active_checks_enabled 0
passive_checks_enabled 1
check_freshness 1
freshness_threshold 1500

And then in my commands

define command{
command_name host-report-down
command_line /usr/lib/nagios/plugins/check_dummy 2 "CRITICAL: Host down"
}


Now i just have to adjust the timing right, so that the freshness is working properly.

Re: passive host check from client

Posted: Wed Feb 24, 2016 3:08 pm
by jolson
The answer have been i front of me the whole time
I managed to get it working, here a copy.
Thanks for providing us with a point of reference - appreciated. Is there anything else that we could help you with, or is this thread good to close?

Re: passive host check from client

Posted: Thu Feb 25, 2016 12:43 am
by bmh
Hi Jolson.

I'm good for now thanks, you can close it :)

Re: passive host check from client

Posted: Thu Feb 25, 2016 11:16 am
by rkennedy
Will do! Closing this one out - feel free to open a new thread if you need any assistance in the future!