欢迎来到天天文库
浏览记录
ID:24450503
大小:377.09 KB
页数:4页
时间:2018-11-14
《cacti监控mongodb和redis数据库配置》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、1、下载模板wgethttp://mysql-cacti-templates.googlecode.com/files/better-cacti-templates-1.1.8.tar.gz2、配置ssh公私钥无需密码登录2.1在监控服务器运行ssh-keygen##如果是root用户,生成的默认目录为/root/.ssh下2个文件id_rsa(公钥)id_rsa.pub(私钥)cd/root/.ssh/&&chmod600id_rsa*把这2个文件修改权限,为600ssh-copy-id-i/root/.ssh/id_r
2、saroot@192.168.200.1#加被监控节点公私钥认证3、配置监控脚本3.1到监控服务器修改文件ss_get_by_ssh.php按如下修改:$ssh_user='root';#SSHusername$ssh_port=22;#SSHport$ssh_iden='-i/root/.ssh/id_rsa';#SSHidentity3.2修改默认探测端口(如果redis不是正常默认端口启动需要修改这些)$memcache_port=11211;#Whichportmemcachedlistenson$redis_po
3、rt=6379;#Whichportredislistenson3.3修改默认探测端口(如果是mongodb不是正常端口启动,则需要这样修改)functionmongodb_cmdline($options){return“echo"db._adminCommand({serverStatus:1,repl:1})”
4、/usr/local/mongo/mongodb/bin/mongo–port10000”;}3.4测试是否配置OK(本例cacti是装到/var/www/html/cacti/目录下)php/var/w
5、ww/html/scripts/ss_get_by_ssh.php--typemongodb--host192.168.200.1--itemsc,de,df,dg,dh,di,dj,dk,dl,dm,dn,do,dp,dq,dr,ds,dt,du四、在cacti里添加mongodb和redis模板:4.1模板导入模板目录为better-cacti-templates-1.1.8templates4.2导入后对被监控机添加模板:4.3添加后为其绘图:五:实际效果测试:此文凝聚笔者不少心血请尊重笔者劳动,转载请注明出处。h
6、ttp://freeze.blog.51cto.com/
此文档下载收益归作者所有