Zabbix MongoDB监控

  


去年监控mongodb设置的模板,包括mongodb连接数,内存,复制延迟,是否大师的监控、下面是一些监控图形示例

 Zabbix mongodb监控


 Zabbix mongodb监控


 Zabbix mongodb监控


 Zabbix mongodb监控


 Zabbix mongodb监控


 Zabbix mongodb监控


 Zabbix mongodb监控


 Zabbix mongodb监控


我们还有一些触发器,比如mongodb实例是否可用,mongodb副本集的角色是否切换。

附件中是mongodb的模板文件,后台的脚本改日再行上传。


后台运行脚本:

# !/bin/bash      # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #   #,,,,,,,,,,mongod_stats.sh ,,,, #   #,,,,,,,,,,written  by  yanglixue ,,,, #   #,,,,,,,,,,,2015/07/08 ,,,,,,,,,,,,, #   # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #      command_line="/opt/mongodb-linux-x86_64-3.0.7/bin/mongo”      username_m="管理"   password_m="密码"      username_c="管理"   password_c="密码"   ,   function  get_mongo_conn (), {   ,,if [, 1美元==,“主”,);   ,,,,用户名=$ {username_m}   ,,,,密码=$ {password_m}   ,,elif [, 1美元==,“二次”,);   ,,,,用户名=$ {username_m}   ,,,,密码=$ {password_m}   ,,elif [, 1美元==,,“配置”);   ,,,,用户名=$ {username_c}   ,,,,密码=$ {password_c}   ,,elif [, 1美元==,蒙戈”,);   ,,,,用户名=$ {username_c}   ,,,,密码=$ {password_c}   fi。才能   ,,command_line=" $ {command_line}, localhost:美元/admin 港- u username 美元;- p $密码"   }      case  $ #,   3)才能   ,,,端口=3美元,,,,   ,,,get_mongo_conn  1美元   ,,,,   ,,,if [, 2美元==,“Repl_lag”,);   ,,,,,,输出=$ (/bin/echo “db.printSlaveReplicationInfo ()”, command_line美元| | grep “behind 从而;主”,| awk ‘{print  1美元}| sed , ' s/?/')   ,,,elif [, 2美元==,“IsMaster”,);   ,,,,,,o1=$ (/bin/echo “db.isMaster () .ismaster”, command_line美元| | sed  -n “3 p”)   ,,,,,,if  [, o1 美元;==,“真实”,);   ,,,,,,,,,=1的输出   ,,,,,,elif  [, o1 美元;==,“false”,);   ,,,,,,,,,输出=0   ,,,,,,   ,,,,,,,,,=1的输出   ,,,,,fi   ,,,,,,   ,,,   ,,,,,,输出=$ (/bin/echo “db.serverStatus”()。2美元,美元| command_line | sed  -n “3 p”)   ,,fi   ,,,;;   4)才能   ,,,端口=4美元   ,,,get_mongo_conn  1美元   ,,,输出=$ (/bin/echo “db.serverStatus()。2。3”美元,美元| command_line | sed  -n “3 p”)   ,,,;;   5)才能   ,,,端口=5美元   ,,,get_mongo_conn  1美元   ,,,输出=$ (/bin/echo “db.serverStatus()。2美元。3。4美元”,| $ command_line | sed  -n “3 p”)   ,,,;;   esac   ,   # check  if 从而,output  contains “NumberLong”   if [[,“输出”美元=~,“NumberLong”,,,));   echo 才能;输出美元| sed  -n ’s/NumberLong (//p”| sed  -n ’s/)//p”   else    echo  $才能输出   fi


  附件:http://down.51cto.com/data/2367256

Zabbix MongoDB监控