The freshness setting doesnt work when the service is in pending state. This is the initial state after setting up the passive check
I tried setting up the passive check with initial state "Up"
Freshness doesn't work with Services in on "Pending" State
-
npolovenko
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Freshness doesn't work with Services in on "Pending" Sta
Hello, @bosecorp. According to the KB article:
https://assets.nagios.com/downloads/nag ... hness.html
Pending state means the "last check" never occurred. Therefore the freshness threshold cannot possibly be compared to something that doesn't exist.For each host/service, the age of its last check result is compared with the freshness threshold.
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.
Re: Freshness doesn't work with Services in on "Pending" Sta
Thanks, that is helpful
so how do I get out of Pending State.
I know I can submit a passive check in the advance tab, but I dont want to do that for every passive service that is in Pending State
so how do I get out of Pending State.
I know I can submit a passive check in the advance tab, but I dont want to do that for every passive service that is in Pending State
-
npolovenko
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Freshness doesn't work with Services in on "Pending" Sta
@bosecorp, Have you tried setting the initial state to OK for all the passive services? You can change it for all services at once with using a Bulk Modifications Tool. I don't think that's going to get freshness checks to work, but at least you won't have services in a pending state.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Freshness doesn't work with Services in on "Pending" Sta
hI
i tried but that setting doesnt take the Passive Service check out of pending state
i tried but that setting doesnt take the Passive Service check out of pending state
-
npolovenko
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Freshness doesn't work with Services in on "Pending" Sta
@bosecorp, I could replicate that. Seems like the only option is to use forced passive checks to set up initial states. One way to do it is to click on a pending service on the home dashboard, navigate to the Advanced tab and then click on "Submit Passive Check Result", Check Result -> UP, Check output -> "test". Or use a custom script to submit passive OK results to multiple passive passive checks instead and set the script to run automatically after each Apply Configuration:
https://assets.nagios.com/downloads/nag ... and_id=114
https://assets.nagios.com/downloads/nag ... and_id=114
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: Freshness doesn't work with Services in on "Pending" Sta
Yes, I knew about the external commands, and I had the same thought
but how can the external command do all services in pending State. do you have an example.
I could do
now=`date +%s`
/bin/printf "[%lu] PROCESS_SERVICE_CHECK_RESULT;host1;Check Service Network - SNMP Trap - Certificate Expired;0;OK: WAITING ON TRAP\n" $now > '/usr/local/nagios/var/rw/nagios.cmd'
but can I make it to do all host instead of just one
but how can the external command do all services in pending State. do you have an example.
I could do
now=`date +%s`
/bin/printf "[%lu] PROCESS_SERVICE_CHECK_RESULT;host1;Check Service Network - SNMP Trap - Certificate Expired;0;OK: WAITING ON TRAP\n" $now > '/usr/local/nagios/var/rw/nagios.cmd'
but can I make it to do all host instead of just one
-
npolovenko
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Freshness doesn't work with Services in on "Pending" Sta
@bosecorp, Last time I checked external commands there was no command to submit a check result for a group of hosts.
https://assets.nagios.com/downloads/nag ... /index.php
Theoretically, you could get a list of services that operate with passive checks. Then you'd put each command from a new line, for each passive service.
Here's another option -> Turn on forced checks after each apply config. That way all passive checks will get green "OK: No data received yet.". The downside is that Nagios will be checking all the other services as well and if your system is large this will put a high load on the server whenever you apply the config.
https://assets.nagios.com/downloads/nag ... /index.php
Theoretically, you could get a list of services that operate with passive checks. Then you'd put each command from a new line, for each passive service.
Here's another option -> Turn on forced checks after each apply config. That way all passive checks will get green "OK: No data received yet.". The downside is that Nagios will be checking all the other services as well and if your system is large this will put a high load on the server whenever you apply the config.
Format: execute_service_checks=<0/1>
Example: execute_service_checks=1
This option determines whether or not Nagios will execute service checks when it initially (re)starts.
Format: execute_host_checks=<0/1>
Example: execute_host_checks=1
This option determines whether or not Nagios will execute on-demand and regularly scheduled host checks when it initially (re)starts.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.