Page 2 of 3

Re: Freshness not working or am i a spacehead...

Posted: Tue Mar 08, 2016 7:31 am
by bmh
Hi jolson.

Hmmm, still not working as it should.
I can see in the log that a hosts is down "HOST ALERT: sydkysten;DOWN;HARD;1;CRITICAL: CRITICAL: Host down" and a secund after i see that the host is up again "HOST ALERT: sydkysten;UP;HARD;1;OK"
and it's not the same host.

In my head is should be like this.
Host down.
check again after 5min
if host not up, alert.

i really can't see what im doing wrong.
we have about 105 clients that sends passive host check every 5min to our server.

Re: Freshness not working or am i a spacehead...

Posted: Tue Mar 08, 2016 3:50 pm
by tmcdonald
I'm having a hard time making sense of your configs. In your first post you had the following:

Code: Select all

client:
define host {
use linux-server
host_name bmhtest
address localhost
check_command check_dummy
check_interval 10
max_check_attempts 2
}
and

Code: Select all

server:
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 10
check_command host-report-down
retry_interval 5
max_check_attempts 4

active_checks_enabled 0
passive_checks_enabled 1
check_freshness 1
freshness_threshold 900

notifications_enabled 1
notification_period 24x7
notification_interval 120
notification_options d,u,s
}
The first one should be using a template named linux-server but you provided what looks like a different host named linux-host which won't play into the first one at all. You also specify a command named check_dummy but then you provide a definition for host-report-down:

Code: Select all

define command{
command_name host-report-down
command_line /usr/lib/nagios/plugins/check_dummy 2 "CRITICAL: Host down"
}
I am also unsure of what you mean by "client" and "server" when specifying the host configs - can you please clarify which is which?

Re: Freshness not working or am i a spacehead...

Posted: Thu Mar 10, 2016 6:37 am
by bmh
tmcdonald:

I'm sorry for the confusion, this is how it looks like.
Client meaning servers placed at costumers, so we clients sending a passive host-check answer to our nagios server every 5min, and that part is working fine, that i can see in the logfile af the nagios server "PASSIVE HOST CHECK: bmhtest;0;OK".

On the client "costumer server"
define host {
use linux-server
host_name bmhtest
address localhost
check_command check_dummy
check_interval 5
max_check_attempts 2
}


The thing that's not working is on the nagios server.
host_freshness_check_interval=60 so it should check every 1min, that a little so much, once every 5min would be fine, freshness_threshold is 10min.
but i see a lot of false/positive errors in the log, and it's bouncing up and down.
seems like something is conflicting, freshness_threshold is 10min, but it is tickert at the first check.

within same secund.
HOST ALERT: rodbyhavn;DOWN;HARD;1;CRITICAL: CRITICAL: Host down
HOST ALERT: rodbyhavn;UP;HARD;1;OK

On nagios server.
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 10
check_command host-report-down
retry_interval 0
max_check_attempts 1
active_checks_enabled 0
passive_checks_enabled 1
check_freshness 1
freshness_threshold 600
notifications_enabled 1
notification_period 24x7
notification_interval 120
notification_options d,u,s

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


I hope that it makes some sence.

Re: Freshness not working or am i a spacehead...

Posted: Thu Mar 10, 2016 4:45 pm
by tmcdonald
I'm even more confused now - you say that you have the following config 'On the client "costumer server"':

Code: Select all

define host {
use linux-server
host_name bmhtest
address localhost
check_command check_dummy
check_interval 5
max_check_attempts 2
}
but these config files should all be on the Nagios server. I also don't see any definition for the rodbyhavn host anywhere, just linux-host.

Re: Freshness not working or am i a spacehead...

Posted: Fri Apr 08, 2016 2:56 am
by bmh
Hi tmcdonald.

Sorry for the late response, i have been busy with other work.
i'll try to explain it better.

Every client server, we have a passive nagios host check that runs every 5min, sending a passive "ok" to our nagios server.

Code: Select all

define host {
  use                           linux-server
  host_name                     bmhtest
  address                       localhost
  check_command                 check_dummy
  check_interval                5
And that part works just fine, i can see that in the log on our nagios server.

On our nagios server, i have this in hosts.cfg

Code: Select all

 define host {
name                                  linux-host
event_handler_enabled                 1
flap_detection_enabled                0
failure_prediction_enabled            1
process_perf_data                     1
retain_status_information             1
retain_nonstatus_information          1
check_period                          24x7
check_interval                        10
check_command                         host-report-down
retry_interval                        3
max_check_attempts                    6
active_checks_enabled                 1
passive_checks_enabled                1
check_freshness                       1
freshness_threshold                   600
And it works.......almost
For some reason i get host down on some clients, but the client is up and running, and i can see that i get the passive "ok" from the clients in time.
And i can't figure out, why it only happens for some clients, and they all have the same configuration.
Hope it makes more sense now, the setup i mean :)

Re: Freshness not working or am i a spacehead...

Posted: Fri Apr 08, 2016 1:36 pm
by tgriep
You should disable Active Checks for that host as that could be causing the check to run and send you the false notifications.
Change the following from

Code: Select all

active_checks_enabled                 1
to

Code: Select all

active_checks_enabled                 0
Save it and see if that fixes it for you.
Also, what version of Nagios are you running?

Re: Freshness not working or am i a spacehead...

Posted: Mon Apr 11, 2016 1:54 am
by bmh
Hi tgriep.

I'm running 3.4.1, and i changed active_checks_enabled to 0, and im gonna wait and see if that would do the trick.
Now that i have changed active_checks_enabled to 0, there is a red cross on every host, saying "Check of this host have been disabled" and it's true, but
it there somehow i can get rid the red cross ?

Re: Freshness not working or am i a spacehead...

Posted: Mon Apr 11, 2016 1:16 pm
by hsmith
Is it showing up on EVERY host, or just the ones you set the active to disabled on?

Re: Freshness not working or am i a spacehead...

Posted: Mon Apr 11, 2016 11:52 pm
by bmh
Hsmith:
It's on those hosts where active check is disabled, and that's all, i'm only using passive host check.

tgriep:
Looks like that the "active_checks_enabled = 0" did the trick :), gonna do some test's today by shutting some of the hosts down.

Re: Freshness not working or am i a spacehead...

Posted: Tue Apr 12, 2016 1:56 pm
by lgroschen
Hey bmh,

Has your testing showed the issue resolved? Let us know if you need more assistance or if we can lock this post, thanks!