Révision bd727d75
avoid blocking in http_responsecode
Just in case there is a firewall dropping packages, this plugin
would block until the plugin timeout is reached. This change introduces
the possibility to configure a much lower individual timeout.
| plugins/http/http_responsecode | ||
|---|---|---|
| 12 | 12 |
The following environment variables are used |
| 13 | 13 |
|
| 14 | 14 |
sites - Sites to check |
| 15 |
max_time - Timeout for each site check - defaults to 5 seconds |
|
| 15 | 16 |
|
| 16 | 17 |
Configuration example |
| 17 | 18 |
|
| 18 | 19 |
[http_responsecode] |
| 19 | 20 |
env.sites example.com example2.de |
| 21 |
env.max_time 5 |
|
| 20 | 22 |
|
| 21 | 23 |
=head1 AUTHOR |
| 22 | 24 |
|
| ... | ... | |
| 63 | 65 |
for site in $sites; do |
| 64 | 66 |
export siteid=`echo $site | sed 's/[^a-z]*//g'` |
| 65 | 67 |
echo -n "$siteid.value " |
| 66 |
curl --write-out %{http_code} --silent --output /dev/null ${site}
|
|
| 68 |
curl --write-out %{http_code} --max-time "${max_time:-5}" --silent --output /dev/null "${site}"
|
|
| 67 | 69 |
echo |
| 68 | 70 |
done |
Formats disponibles : Unified diff