Home  >  Article  >  Database  >  MMS 使用Munin-Node对硬件进行监控(11)

MMS 使用Munin-Node对硬件进行监控(11)

WBOY
WBOYOriginal
2016-06-07 16:38:161191browse

MMS还可以服务器硬件进行监控,默认情况下,是收集不到数据的,需要安装munin-node来收集硬件统计信息的。点Hardware时,发现No data available。如图所示: 使用munin-node监控硬件 munin-node项目地址:http://munin-monitoring.org/http://munin.readthedo

MMS还可以服务器硬件进行监控,默认情况下,是收集不到数据的,需要安装munin-node来收集硬件统计信息的。 点Hardware时,发现No data available。如图所示: mms-munin-1

使用munin-node监控硬件

munin-node项目地址: http://munin-monitoring.org/ http://munin.readthedocs.org/en/latest/master/index.html munin-node是一个perl脚本。呵呵,有空去读读,顺便改造下能远程实行系统命令,岂不美哉。 MMS提供了通过munin来对硬件统计信息的收集和绘图。必需要在所需监控的主机上安装munin-node包。同时,需要确保监控代理可以访问munin-node服务的监听端口4949。 注意:munin-node和硬件监控只支持在Linux平台上的MongoDB实例。 Debian 和 Ubuntu 系统下:
sudo apt-get install munin-node
centos、RedHat、Fedora 系统下: 需要先安装EPEL源。
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
yum install munin-node
/etc/init.d/munin-node start
chkconfig munin-node on
munin-node默认只允许本地连接,需要对需要连接的IP进行授权。
# vim /etc/munin/munin-node.conf 
cidr_allow 10.0.0.0/8
我这里是运行10.0.0.0这个段所有IP。如果允许单个IP,添加allow ^10\.0\.100\.125$ mms-munin-2 munin支持的全部插件位于/usr/share/munin/plugins目录下。 启用的插件位于/etc/munin/plugins目录下。可以看到/etc/munin/plugins目录下的文件是指向/usr/share/munin/plugins目录下的文件的。 mms-munin-3 因此对于上面telnet不支持的iostat、iostat_ios可以这么来解决。
# cd /etc/munin/plugins/
# ln -s /usr/share/munin/plugins/iostat iostat
# ln -s /usr/share/munin/plugins/iostat_ios iostat_ios
# /etc/init.d/munin-node restart
这样就可以获得到iostat、iostat_ios信息了。 mms-munin-4 如果要启用munin某个插件就可以这么来做: cd /etc/munin/plugins/ sudo ln -s /usr/share/munin/plugins/

其他注意事项:

1.?如果你有编号的磁盘设备,如/dev/sda1和/dev/sda2,那么就需要配置munin iostat插件来支持。编辑/etc/munin/plugin-conf.d/munin-node文件,添加下面内容: [iostat] env.SHOW_NUMBERED 1 2.如果munin有启用,但是?iostat ios数据没有出现。很可能munin-node没有权限访问munin/plugin-state/ 目录下的状态文件。查看/var/log/munin-node/munin-node.log日志查看文件的具体路径。可以使用以下方法解决:
touch /var/lib/munin/plugin-state/iostat-ios.state
chown -R [username]:[group] /var/lib/munin/plugin-state/
chmod -R 660 /var/lib/munin/plugin-state/
username和group更改为munin-node执行的用户名和组。 3. 权限的问题。上面已经提到过的,默认情况下4949端口只允许本地连接的。需要修改/etc/munin/munin-node.conf 文件和防火墙来允许来源IP访问。 再返回来,看看前面有关硬件的监控信息有没有获取到数据: mms-munin-5 这次取到了数据。怎么监控其他硬件信息呢?
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn