Freshness not working or am i a spacehead...

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
bmh
Posts: 14
Joined: Tue Feb 23, 2016 2:23 am

Freshness not working or am i a spacehead...

Post by bmh »

Hi all.

I have made it so that client's are making a passive host check, and send it to the server every 10min, and the server's freshness is 15min, so i should be fine.
however, i see the server report's "CRITICAL: Host down from my command_line"now and then, but the client is up.
And i the log at the server i see that the check is received every 10min's and sometimes with a few minutes apart "still can't figure out why" but it's never 15min old.
Do i misunderstand Freshness or what im i doing wrong ?


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

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
}

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

example from log:
[Wed Mar 2 11:16:41 2016 GMT] HOST ALERT: morso;UP;HARD;1;OK
[Wed Mar 2 11:16:41 2016 GMT] HOST ALERT: morso;DOWN;SOFT;1;CRITICAL: CRITICAL: Host down
[Wed Mar 2 11:33:28 2016 GMT] HOST ALERT: morso;DOWN;SOFT;2;CRITICAL: CRITICAL: Host down
[Wed Mar 2 11:33:48 2016 GMT] HOST ALERT: morso;DOWN;SOFT;3;CRITICAL: CRITICAL: Host down
[Wed Mar 2 11:34:07 2016 GMT] HOST ALERT: morso;DOWN;HARD;4;CRITICAL: CRITICAL: Host down
[Wed Mar 2 11:37:48 2016 GMT] HOST ALERT: morso;UP;HARD;1;OK
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

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

Post by hsmith »

Do you see anything about it being 'stale'?
Former Nagios Employee.
me.
bmh
Posts: 14
Joined: Tue Feb 23, 2016 2:23 am

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

Post by bmh »

hsmith:

No, nothing Stale.
It's like that the freshness is not working for some reason, cause i see "PASSIVE HOST CHECK: clientname;0;OK" every 10min, and
freshness is set to 15min, so it shouldn't register it like down.
User avatar
nozlaf
Posts: 172
Joined: Sun Nov 09, 2014 9:50 pm
Location: Victoria, Australia

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

Post by nozlaf »

in your main config (nagios.cfg) have you specified check_host_freshness and host_freshness_check_interval ?
Looking forward to seeing you all at #NagiosCon2019?
-Dedicated Lover of Nconf,PNP4Nagios and Nagvis
bmh
Posts: 14
Joined: Tue Feb 23, 2016 2:23 am

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

Post by bmh »

nozlaf:

Yes, in nagios.cfg it's set like this.
check_host_freshness=1
host_freshness_check_interval=600

I also have a hosts.cfg that is a template, and i that i have.
freshness_threshold 900

thinking...
what is the difference between host_freshness_check_interval=600 and freshness_threshold if any, and does the hosts.cfg template override the values in nagios.cfg?
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

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

Post by jolson »

host_freshness_check_interval
This setting determines how often (in seconds) Nagios will periodically check the "freshness" of host check results. If you have disabled host freshness checking (with the check_host_freshness option), this option has no effect. More information on freshness checking can be found here.
Try setting host_freshness_check_interval to 60 and restart nagios.

Code: Select all

sed -i 's/host_freshness_check_interval=600/host_freshness_check_interval=60/' /usr/local/nagios/etc/nagios.cfg
service nagios restart
I think that the host_freshness_check_interval being set to 60 means that it will check every minute - 600 means that it will check every 10 minutes.

If Nagios checks freshness once every ten minutes, this could be throwing your expected results off. Could you give the above a try?

freshness_threshold is how old the check has to be stale before you experience a warning, where the host_freshness_check_interval dictates how much time Nagios waits in between freshness checks.
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
bmh
Posts: 14
Joined: Tue Feb 23, 2016 2:23 am

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

Post by bmh »

Jolson:

I got the part about host_freshness, but i could not find any clear info about freshness_threshold, thanks for clearing that up.
I've changed the host_freshness to 60, and freshness_threshold to 5.

So Nagios should check every 1 minute, and the threshold should be triggert if the host check is older than 5 minutes right ?
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

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

Post by jolson »

So Nagios should check every 1 minute, and the threshold should be triggert if the host check is older than 5 minutes right ?
That is correct - is this working for you?
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
bmh
Posts: 14
Joined: Tue Feb 23, 2016 2:23 am

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

Post by bmh »

jolson:

I've changed freshness_threshold to 10 min this morning, cause i made a little mistake by setting it to 5 min and the clients are sending passive host check every 5 minutes, that
could cause some false positive errors, if the server should be loaded.
I'll let you know if that did the trick, as soon as i know :)
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

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

Post by jolson »

Excellent, thank you!
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
Locked