How could I monitor a service port from a bash shell?
I want to monitor a Java service (once per minute on port 9090) and then call "/etc/init.d/myservice -restart" if the service isn't responding with a simple HTML message.
How would you do something like this?
My idea was to use something similar to this:
wget -O - --no-check-certificate --progress=dot https://localhost:9090
Or
curl --insecure https://localhost:9090
-o
) to/dev/null
, how can you print any page content? You're probably print the verbose output of curl. If you want the content of the page try to remove--verbose
and-vs
and-o /dev/null
and leave only--insecure