Simple HTTP Status Monitor Using Curl

Using some output redirection and the --write-out parameter we can produce a script that simply outputs the status code of a curl request. This script can then be used as the basis for a simple monitoring of a URL. #! /bin/bash # Description: Returns the HTTP response code obtained by curl on the URL using the specified HTTP method # Usage: script.sh GET https://example.org # Usage: scripts.sh POST https://example.org # Author: marco@kamner. [Read More]

curl: Modify DNS Resolution

You can intercept normal name resolution in curl with the --resolve parameter allowing you to do things like talk to a specific site of a DNS load-balanced setup or talk to a new deployment not yet made productive. You can specify the resolve option multiple times so you can even catch redirects and move them to where you want as well. It’s important to note that this intercept does only work on the ports you specify in the entries. [Read More]