Closed Yanncha closed 2 years ago
Hi,
It works for me. I will also add it to the automatic test.
I put this to the hostname list:
http-status;https://www.heise.de;200
The curl command is then:
curl "$MY_CURL_PARAMETERS" -s -o /dev/null -I --max-time "$MY_TIMEOUT" -w "%{http_code}" "$MY_HOSTNAME" 2>/dev/null
Example:
curl -s -o /dev/null -I --max-time "30" -w "%{http_code}" "https://www.heise.de/ping" 2>/dev/null
google.fr:
$ curl -s -o /dev/null -I --max-time "30" -w "%{http_code}" "http://www.google.fr" 2>/dev/null
200
What error do you get with the curl commands?
Hi ! Thanks for your quick answer.
If I add http-status;https://www.heise.de;200
to the hostname list, it fails as well with a DOWN.
If I enter the curl commands you sent me, it works (for both) : no error is displayed, and 200 appears in the console after the command.
I believe I have found the error. I'll publish a fix in a moment.
The error was the parameter MY_CURL_PARAMETERS
implemented with commit https://github.com/Cyclenerd/static_status/commit/7d5d4745b78364fa447a8f4cc2a841d235397b12.
I have removed that now with commit https://github.com/Cyclenerd/static_status/commit/e335e91472263df3d8c65f9dd6d56915666d5139. curl parameters can be better passed with the .curlrc
config file.
FYI @e-minguez: configure -k
(insecure) now with curlrc please.
Thanks ! I tried on my side with your fix, it works fine (with above cases).
Happy to hear that. Thank you for finding the error.
Glad to (modeslty) help ! :)
Hello all !
First, thanks to all contributors for this simple yet useful script, I was looking for exactly this kind of soft.
I have trouble having http-status command to work, with the following lines in the hosts list : http-status;http://localhost;200 http-status;http://www.google.fr;200
If I do a curl -I on these addresses, the 1st line is as expected : HTTP/1.1 200 OK Am I missing something ? I tried both on an Apache webserver (with config lines above) and on my laptop, replacing localhost with the webserver address, and the result is the same. I'm using I think the latest script version from commit dfa2280f6808302a711a51a9108247409520fc64
Thanks in advance for your help. Yc