Passive check, freshness at a custom date

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.
Locked
Nikoo
Posts: 3
Joined: Mon Mar 30, 2020 12:17 pm

Passive check, freshness at a custom date

Post by Nikoo »

Hello team,

I am currently having an issue on a Passive check: I have a custom script that will be run each first day of the month at 05AM (I do not have control about running time, it could take some minutes to an hour up to 3 hours), I need to monitor this behavior and found the following Nagios' cases:
  • my Bash script has crashed: I handle sending notification to nagios via NSCA.
  • my Bash script worked: same behavior as above.
The last case, my script did not run (crontab disabled, permission modified on my script...): in that case Nagios did not receive freshness update on this passive check.

I have the following questions :
  • How can I set-up my passive check to be only performed on the 1st day of each month ?
  • How is calculated the freshness_threshold based on the previous passive check ?
I am currently using the following test templates on my lab to perform some try and error, but no good answer at the moment:

timeperiod configuration:

Code: Select all

define timeperiod {

    name                    mondayonly
    timeperiod_name         mondayonly
    alias                   Monday Work Hours

    monday                  19:20-19:22
    #day 1                  11:00-11:02
}
localhost config:

Code: Select all

define service {
   service_description           FOLDER-clean
   check_command                 no-folder-report
   host_name                     localhost
   contact_groups                admins
   flap_detection_enabled        0
   event_handler_enabled         0
   max_check_attempts		 1
   check_interval          	 1
   retry_interval          	 1
   active_checks_enabled   	 0
   passive_checks_enabled  	 1
   notifications_enabled   	 1
   check_freshness         	 1
   freshness_threshold     	 90
   check_period            	 mondayonly
}


define command {
    command_name    no-folder-report
    command_line    /usr/lib64/nagios/plugins/check_dummy 2 "CRITICAL: Results of job were not reported!"
}
As I do not know when my script could finished (at least, it could be less than 2 hours), my goal is to start my scrip at 05AM, and if at 11AM, Nagios did not received a status update (OK or Critical), it will generate a critical alert.

Reagrds,

Nicolas
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Passive check, freshness at a custom date

Post by Box293 »

From what I understand, freshness checks do not adhere to timeperiods. It is simply checking the age of the last check result against the freshness threshold. There is a good explanation here in the documentation:

https://assets.nagios.com/downloads/nag ... hness.html
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Nikoo
Posts: 3
Joined: Mon Mar 30, 2020 12:17 pm

Re: Passive check, freshness at a custom date

Post by Nikoo »

Yes you're right,

I discover that page too.

I may have missed some documentation, but is it possible to set-up nagios passive check to await an update on a given number of day; such as "day 1 + 39600".

With this setting, we know that a service update will occure the first day of each month before 11AM. If the update is delayed after 11AM or not send at all, the freshness will be over 11AM and triggered an alert.

Regards,

Nicolas
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Passive check, freshness at a custom date

Post by scottwilkerson »

Nikoo wrote:Yes you're right,

I discover that page too.

I may have missed some documentation, but is it possible to set-up nagios passive check to await an update on a given number of day; such as "day 1 + 39600".

With this setting, we know that a service update will occure the first day of each month before 11AM. If the update is delayed after 11AM or not send at all, the freshness will be over 11AM and triggered an alert.

Regards,

Nicolas
No, this is not possible
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Nikoo
Posts: 3
Joined: Mon Mar 30, 2020 12:17 pm

Re: Passive check, freshness at a custom date

Post by Nikoo »

Hello,

Could I submit a feature request on github ?

Best regards,

Nicolas
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Passive check, freshness at a custom date

Post by scottwilkerson »

Nikoo wrote:Hello,

Could I submit a feature request on github ?

Best regards,

Nicolas
sure
https://github.com/NagiosEnterprises/nagioscore/issues
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked