自动发现清单变量或者键值填写 get_web,监控项原型填写 web_site_code{#name}
自动发现清单填写 json 字符串需要的函数,监控原型填写触发器的规则,监控项原型传的参数为自动发现规则的变量,下面是监控项原型的变量
200
[root@localhost ~]# bash zabbix.sh web_site_code www.baidu.com
}
]
{"{#NAME}":"www.hao123.com"}
{"data":[{"{#NAME}":"www.baidu.com"},
[root@localhost ~]# bash zabbix.sh get_web
###3 备注
$1 $2
}
{/usr/bin/curl -I -m 10 -o /dev/null -s -w %{http_code} "$1"
function web_site_code()
}
printf "\n\t]\n"printf"}\n"
done
fi
printf ','
if [$i -lt $[$length-1] ];then
printf "\"{#NAME}\":\"${web[$i]}\"}"
printf '\n\t\t{'
do
printf '\t'"\"data\":["for ((i=0;i<$length;i++))
printf "{\n"
function get_web(){length=${#web[@]}
web=('www.baidu.com' 'www.hao123.com')
# Script to fetch nginx statuses for tribily monitoring systems
#!/bin/bash
原文:http://blog.51cto.com/wsxxsl/2051483
来源: http://www.bubuko.com/infodetail-2431575.html