Submitted by yngens on Thu, 09/04/2014 - 08:20
I am trying to implement the similar check described on http://www.computerminds.co.uk/articles/monitoring-varnish using only Virtualmin's "System and Server Status" feature without installing Monit.
Adding the following lines to "default.vcl" file works perfectly well:
sub vcl_recv {
# Change this URL to something that will NEVER be a real URL for the hosted
# site, it will be effectively inaccessible.
if (req.url == "/monit-check-url-qwertyuiop") {
error 200 "Varnish up";
}
}
and checking it with:
curl -s --head 127.0.0.1:80/check-url-qwertyuiop | head -n 1
gives:
HTTP/1.1 200 Varnish up
Would be very nice if Virtualmin could also check URLs and execute restart command depending of the URL check - if it returns "HTTP/1.1 200" then do nothing, but if returns "HTTP/1.1 301" then restart command, in this case Varnish deamon.
Thanks for consideration!
Status:
Closed (fixed)
Comments
Submitted by JamieCameron on Thu, 09/04/2014 - 12:25 Comment #1
This is already possible - the System and Server Status module has a "Remote HTTP Service" monitor type, and you can enter a command to run if the URL fetch fails.
Submitted by yngens on Fri, 09/05/2014 - 05:27 Comment #2
Edit: Tests proved everything works as desired, thank you very much!
Submitted by Issues on Fri, 09/19/2014 - 05:31 Comment #3
Automatically closed -- issue fixed for 2 weeks with no activity.
Submitted by Issues on Fri, 09/19/2014 - 05:31 Comment #4
Automatically closed -- issue fixed for 2 weeks with no activity.