etc/mon.cfg [default]
log_file=mymon.log # ÈÕ־·¾¶ºÍÎļþÃû # Panic 0 # Fatal 1 # Error 2 # Warn 3 # Info 4 # Debug 5
log_level=4 # ÈÕÖ¾¼¶±ð
falcon_client=http://127.0.0.1:1988/v1/push # falcon agentÁ¬½ÓµØÖ·
#×Ô¶¨Òåendpoint
endpoint=127.0.0.1 #Èô²»ÉèÖÃÔòʹÓÃOSµÄhostname
[mysql]
user=root # Êý¾Ý¿âÓû§Ãû password= # Êý¾Ý¿âÃÜÂë
host=127.0.0.1 # Êý¾Ý¿âÁ¬½ÓµØÖ· port=3306 # Êý¾Ý¿â¶Ë¿Ú
MySQL metrics
Çë²Î¿¼./metrics.txt£¬ÆäÖеÄÄÚÈÝ£¬½ö¹©²Î¿¼£¬¸ù¾ÝMySQLµÄ°æ±¾¡¢ÅäÖò»Í¬£¬²É¼¯µ½µÄmetricsÒ²Óвî±ð¡£
8.redis ¼à¿Ø
ÐèÇó£ºPython >= 2.6python-simplejson yum install python-simplejson -y
ʹÓ÷½·¨
1. ¸ù¾Ýʵ¼Ê²¿ÊðÇé¿ö£¬ÐÞ¸ÄÓÐ×¢ÊÍλÖø½½üµÄÅäÖà 2. ²âÊÔ£º python redis-monitor.py 3. ½«½Å±¾¼ÓÈëcrontabÖ´Ðм´¿É ×¢Ò⣺
1.ÐÞ¸Äredis-monitor.pyʱ£¬_redis_cli = '/usr/local/bin/redis-cli'·¾¶Ò»¶¨ÒªÕýÈ·£¬ÐÞ¸Äǰwhereis redis_cli¼ì²éÈ·ÈÏÆä·¾¶¡£
2.#inst_listÖб£´æÁËredisÅäÖÃÎļþÁÐ±í£¬³ÌÐò½«´ÓÕâЩÅäÖÃÖжÁÈ¡portºÍpassword£¬½¨ÒéʹÓö¯Ì¬·¢Ïֵķ½·¨»ñµÃ£¬È磺
# inst_list = [ i for i in commands.getoutput(\/etc/ -name 'redis*.conf'\ʹÓÃÍÆ¼öµÄredisÅäÖÃÁбí»ñÈ¡·½Ê½ insts_list
=
[
i
for
i
in
commands.getoutput(\
/opt/redis-3.0.2/cluster/ -name 'redis*.conf'\
3.ÐÞ¸ÄOpenfalcon¼à¿ØÖ÷»úµØÖ·
url = 'http://10.192.40.151:1988/v1/push' 4.ÐÞ¸ÄÖ÷»úhost