Poul-Henning Kamp wrote: > In message <4b1f7fed.4020...@boerse-go.de>, Mark Plomer writes: > >> Hi, >> is it possible to retrieve some more details about the current backend >> status via the telnet interface? >> A list of all backends with current status (up/down) would be very >> helpful for monitoring. >> For the beginning, it would be enough to have the count of backends and >> the count of up-/down- backends >> in the "stats" output. >> > > There is an undocumented "debug.health" command you can try. > > Ideas for a final version of this are most welcom. > > Brilliant. At the moment we tail the varnishlog, post process, and write out to disk for further monitoring. Here's the PHP we're using:
#!/usr/local/bin/php <?php $p = popen('varnishlog -u -i Backend_health','r'); $health = array(); while (!feof($p)) { $l = fgets($p); if ($m = preg_match("/^.*Backend_health - ([^ ]+) [^ ]+ ([^ ]+) /Uis", $l, $matches)) { if ($matches[2] != $health[$matches[1]]) { $health[$matches[1]] = $matches[2]; file_put_contents("/tmp/varnishbackendhealth", print_r($health,true)); } } } ?> Our monitoring then records "grep -c healthy /tmp/varnishbackendhealth" However, it looks like we can now use the far simpler: echo 'debug.health' | nc localhost 6082 |grep -c Healthy So - thanks for the change! Rob _______________________________________________ varnish-misc mailing list varnish-misc@projects.linpro.no http://projects.linpro.no/mailman/listinfo/varnish-misc