Smokeping_probes_basefork(3) | SmokePing | Smokeping_probes_basefork(3) |
Smokeping::probes::basefork - Yet Another Base Class for implementing SmokePing Probes
Like Smokeping::probes::basevars, but supports the probe-specific property `forks' to determine how many processes should be run concurrently. The targets are pinged one at a time, and the number of pings sent can vary between targets.
*** Probes *** +basefork forks = 5 offset = 50% step = 300 timeout = 15 # The following variables can be overridden in each target section pings = 5 # [...] *** Targets *** probe = basefork # if this should be the default probe # [...] + mytarget # probe = basefork # if the default probe is something else host = my.host pings = 5
Not all pinger programs support testing multiple hosts in a single go like fping(1). If the measurement takes long enough, there may be not enough time perform all the tests in the time available. For example, if the test takes 30 seconds, measuring ten hosts already fills up the SmokePing default five minute step.
Thus, it may be necessary to do some of the tests concurrently. This module defines the ping method that forks the requested number of concurrent processes and calls the pingone method that derived classes must provide.
The pingone method is called with one argument: a hash containing the target that is to be measured. The contents of the hash are described in Smokeping::probes::basevars(3pm).
The number of concurrent processes is determined by the probe-specific variable `forks' and is 5 by default. If there are more targets than this value, another round of forks is done after the first processes are finished. This continues until all the targets have been tested.
The timeout in which each child has to finish is set to 5 seconds multiplied by the maximum number of 'pings' of the targets. You can set the base timeout differently if you want to, using the timeout property of the probe in the master config file (this again will be multiplied by the maximum number of pings). The probe itself can also provide another default value if desired by modifying the _default value of the timeout variable.
If the child isn't finished when the timeout occurs, it will be killed along with any processes it has started.
The number of pings sent can be specified in the target-specific variable 'pings'.
Supported probe-specific variables:
Example value: 5
Default value: 5
Example value: 50%
Example value: 300
Example value: 15
Default value: 5
Supported target-specific variables:
Example value: 5
Niko Tyni <ntyni@iki.fi>
Smokeping::probes::basevars, Smokeping::probes::EchoPing
2022-10-15 | 2.7.3 |