Hunter的大杂烩 技术学习笔记

September 2, 2014

ganglia/nagios集成

Filed under: 技术话题 — hunter @ 5:24 pm

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

优点是可以批量获取、设置多个指标

No Comments

No comments yet.

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Powered by WordPress