1. 用了自带的python client
优点是可以比较精细获取某个指标 ,比如我用这个来判断没有外网IP的机器是否存活:
#!/bin/sh
if [ $# -lt 1 ];then
echo “USAGE: $0 [host]”
exit
fi
retmsg=`/opt/ganglia/bin/ganglia –host=${gmond_ip} –port=${gmond_port} –alive=$1 |grep True`
if [ -z $retmsg ];
then
echo “CRITICAL: host:” $1 ” is dead!”
exit 2
else
echo “OK:host:” $1 ” is alive”
exit 0
fi
2. 用了ganglia-nagios-bridge
优点是可以批量获取、设置多个指标