zabbix监控varnish(shell)

#!/bin/bash

/usr/local/bin/varnishstat -1 > /tmp/varnish.$$

awk '{
        printf ("%s:%s ",$1,$2)
}' /tmp/varnish.$$

rm -rf /tmp/varnish.$$

Usage:


As root setup a cronjob:

* * * * * /usr/local/varnish/bin/varnishstat  -1 > /tmp/varnishstat


Add an user parameter to zabbix:

UserParameter=varnish.stat[*],cat /tmp/varnishstat | grep "$1 " | awk '{print $$2}'


本文出自 “muzinan的技术博客” 博客,谢绝转载!

你可能感兴趣的:(varnish,zabbix)