Force checks to run sequentially
-
amprantino
- Posts: 140
- Joined: Thu Apr 18, 2013 8:25 am
- Location: libexec
Force checks to run sequentially
Hello all,
I would like to poll a device that has very very very slow SNMP response.
Is there a way to force two (or more checks) run sequentially?
Or otherwise, is there a way to force two checks run different time?
Thank you
I would like to poll a device that has very very very slow SNMP response.
Is there a way to force two (or more checks) run sequentially?
Or otherwise, is there a way to force two checks run different time?
Thank you
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: Force checks to run sequentially
From the check_snmp help:
https://exchange.nagios.org/directory/P ... ti/details
Otherwise you might want to look at check_multi:- Multiple OIDs (and labels) may be indicated by a comma or space-delimited
list (lists with internal spaces must be quoted).
- See:
https://www.nagios-plugins.org/doc/guid ... HOLDFORMAT
for THRESHOLD format and examples.
- When checking multiple OIDs, separate ranges by commas like '-w 1:10,1:,:20'
- Note that only one string and one regex may be checked at present
https://exchange.nagios.org/directory/P ... ti/details
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
amprantino
- Posts: 140
- Joined: Thu Apr 18, 2013 8:25 am
- Location: libexec
Re: Force checks to run sequentially
Not exactly.
Host1 --> Check1
|--> Check2
|--> Check3
Each check runs independently, checking a host that needs about 90 seconds to return the required snmp values.
I would like check1 , check2 and check3 to run sequentially.
Also, I don't want to merge all these into one check using check_multi.
Host1 --> Check1
|--> Check2
|--> Check3
Each check runs independently, checking a host that needs about 90 seconds to return the required snmp values.
I would like check1 , check2 and check3 to run sequentially.
Also, I don't want to merge all these into one check using check_multi.
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: Force checks to run sequentially
Sorry I now understand what you mean.
There isn't that kind of support built into the box with Nagios.
The easiest way I could think of doing this is to create a bash script that:
Create a very complicated timeperiod definition that defined check1 could only execute on minutes 00:01-00:02,00:11-00:12, etc for every hour for every day.
Repeat for the other checks.
That would only ensure they wouldn't be scheduled at the same time, but does not prevent them from overlapping.
There isn't that kind of support built into the box with Nagios.
The easiest way I could think of doing this is to create a bash script that:
- receives the check command with all the arguments
checks a temp file to see if one of the others is running, if they are not, update the temp file to say they are running otherwise exit with a state saying they are running
execute the check
update the temp file so it's recorded it's no longer running
Create a very complicated timeperiod definition that defined check1 could only execute on minutes 00:01-00:02,00:11-00:12, etc for every hour for every day.
Repeat for the other checks.
That would only ensure they wouldn't be scheduled at the same time, but does not prevent them from overlapping.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
amprantino
- Posts: 140
- Joined: Thu Apr 18, 2013 8:25 am
- Location: libexec
Re: Force checks to run sequentially
This is the only solution I have thought too, but this cant expand to many services.Box293 wrote: It's complicated, but the only other way I though was:
Create a very complicated timeperiod definition that defined check1 could only execute on minutes 00:01-00:02,00:11-00:12, etc for every hour for every day.
Repeat for the other checks.
That would only ensure they wouldn't be scheduled at the same time, but does not prevent them from overlapping.
I want the service checks to run only twice a day (early in morning and late at night).
By assuming that every check does less than 2 minutes to run, I define the following check_period:
check1: 8.00-8.05
check2: 8.15-8.20
check3: 8.30-8.35
I think this is enough to prevent services from running the same time, including a small retry check_interval
Probably in a future versions, nagios could have a group with services that cant run in parallel.
Re: Force checks to run sequentially
If you're looking to scale this, you could always do so using a template that references the timeperiod's.
It's a bit difficult to make sure checks run in parallel, but I can bring it up for discussion. Is there a specific reason for the slow response from the server over SNMP?
It's a bit difficult to make sure checks run in parallel, but I can bring it up for discussion. Is there a specific reason for the slow response from the server over SNMP?
Former Nagios Employee
-
amprantino
- Posts: 140
- Joined: Thu Apr 18, 2013 8:25 am
- Location: libexec
Re: Force checks to run sequentially
Actually it isn't a server but an Avaya telephone center. It's extremely slow...
I want to verify that all PRI lines are functional.
I want to verify that all PRI lines are functional.
Not in parallel, so delays don't go beyond 90 secsrkennedy wrote:......
It's a bit difficult to make sure checks run in parallel, ..........
Re: Force checks to run sequentially
Ah, I misunderstood at first. Before I file the feature request, just want to make sure I understand properly.
This would be an option, where only one type of this check could be executed on a certain host at a time, to prevent multiple requests going at it.
Is that right now?
This would be an option, where only one type of this check could be executed on a certain host at a time, to prevent multiple requests going at it.
Is that right now?
Former Nagios Employee
-
amprantino
- Posts: 140
- Joined: Thu Apr 18, 2013 8:25 am
- Location: libexec
Re: Force checks to run sequentially
For example, I have configured:
Host1 --> Check1
|--> Check2
|--> Check3
I would like these to be executed (time-sequence):
Start Check1
Finished Check1
Start Check2
Finished Check2
Start Check3
Finished Check3
Check execution order (of services) is not very important, at least for me.
Feature Request: (just an idea)
Inside a servicegroup definition, we can assign a specific (optional) parameter like sequential 1.
All services that belongs in this group cant be run in parallel, but only sequentially
define servicegroup{
servicegroup_name servers_slow_services
members host1,check1,host1,check2,host1,check3
sequential 1
}
Host1 --> Check1
|--> Check2
|--> Check3
I would like these to be executed (time-sequence):
Start Check1
Finished Check1
Start Check2
Finished Check2
Start Check3
Finished Check3
Check execution order (of services) is not very important, at least for me.
Feature Request: (just an idea)
Inside a servicegroup definition, we can assign a specific (optional) parameter like sequential 1.
All services that belongs in this group cant be run in parallel, but only sequentially
define servicegroup{
servicegroup_name servers_slow_services
members host1,check1,host1,check2,host1,check3
sequential 1
}
Re: Force checks to run sequentially
I get how your idea is a good one, but I could see where this would have some issues with templates and inheritance. If they approve us submitting a feature request, I'll update this post.
For now, is there an issue with the solution Troy posted?
For now, is there an issue with the solution Troy posted?
Box293 wrote:The easiest way I could think of doing this is to create a bash script that:
receives the check command with all the arguments
checks a temp file to see if one of the others is running, if they are not, update the temp file to say they are running otherwise exit with a state saying they are running
execute the check
update the temp file so it's recorded it's no longer running
Former Nagios Employee.
me.
me.