Projet

Général

Profil

Révision bd727d75

IDbd727d75f91a013d8d63f384850c6557e7a14331
Parent 3a2f2ec7
Enfant f6ea58d5

Ajouté par Thomas Heidrich il y a environ 5 ans

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.

Voir les différences:

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