对于互联网公司squid是必不可缺的。 而要确认所有squid节点是否压缩正常是比较麻烦的事情。
但是其实用wget就可以解决这个问题,我们可以把这个写到nagios插件中使用就可以了。
这里我们使用www.zongheng.com的一个squid节点58.215.101.182
wget -S --spider --header="Accept-Encoding:gzip,deflate" --header="Host:www.zongheng.com" http://58.215.101.182
以下为参数解释
-S: 打印出响应头信息。下面是打印出的信息。
开启 Spider 模式。检查是否存在远程文件。 --2010-07-18 10:33:10-- http://58.215.101.182/ 正在连接 58.215.101.182:80... 已连接。 已发出 HTTP 请求,正在等待回应... HTTP/1.0 200 OK Server: ZHWS-0.6 Date: Sun, 18 Jul 2010 02:33:11 GMT Content-Type: text/html; charset=UTF-8 Vary: Accept-Encoding Cache-Control: no-cache Expires: Thu, 01 Dec 1994 16:00:00 GMT Set-Cookie: JSESSIONID=abchaeKZaaLJ25EcuzJNs; path=/ Content-Encoding: gzip X-Cache: MISS from zw2squid.zongheng.com X-Cache-Lookup: MISS from zw2squid.zongheng.com:80 Via: 1.0 zw2squid.zongheng.com:80 (squid/2.6.STABLE21) Connection: keep-alive