CentOS Linux安装munin
来源:互联网 发布:2016小米抢购软件 编辑:程序博客网 时间:2024/06/10 02:14
转自:http://www.live-in.org/archives/1221.html
Munin是一个网络资源监控工具,通过自带插件可以监控很多系统服务。官网:http://munin-monitoring.org/。Munin需要在web server上运行。这里系统为CentOS6.2,监控机IP为192.168.1.100,被监控机IP为192.168.1.200。经过比较,不使用复杂的源码编译安装,参考官方wiki上使用yum方式安装。
一、监控机配置(Munin master)
0、先安装web server
这里使用apache。
yum install httpd
apache基本配置略过。Munin也可以运行在一个Java的web server上(Resin from www.caucho.com)。
1、安装EPEL源
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm
vim /etc/yum.repos.d/dag.repo
输入:
[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
gpgkey=http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
enabled=1
2、安装munin
yum install munin
3、简单配置munin master
安装完后在/var/www/html会有munin目录,/etc下也有munin目录。
PS:刚安装完/var/www/html/munin目录下是没有index.html,但后面登陆时会自动生成的。
vim /etc/munin/munin.conf
将以下几行的注释去掉:
dbdir /var/lib/muninhtmldir /var/www/html/muninlogdir /var/log/muninrundir /var/run/munintmpldir /etc/munin/templates
将以下监控本机的代码注释掉:
#[x86-07.phx2.fedoraproject.org]# address 127.0.0.1# use_node_name yes
同时添加被监控机地址:
[server01]
address 192.168.1.200
use_node_name yes
use_node_name命令控制munin命名节点的方式,如果后面跟的参数为yes就是用括号中的值来命名,如果是no则将执行一个DNS查询。
4、设置登陆用户和密码:
htpasswd -c /etc/munin/munin-htpasswd muninadmin
输入两遍密码。这里建立了一个名为muninadmin的用户。
5、安装完munin服务端后,程序会自动创建一个计划任务
cat /etc/cron.d/munin
可以看到是每5分钟获取一次数据:
*/5 * * * * munin test -x /usr/bin/munin-cron && /usr/bin/munin-cron
需要启动crond服务:
service crond start
6、重启httpd
service httpd restart
二、被监控机配置(Munin node)
1、也需要安装EPEL源
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm
vim /etc/yum.repos.d/dag.repo
输入:
[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
gpgkey=http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
enabled=1
2、安装munin-node
yum install munin-node
3、配置munin node
vim /etc/munin/munin-node.conf
找到:
allow ^127\.0\.0\.1$
这里是表示允许谁来获取信息,在下面加上监控机IP:
allow ^192\.168\.1\.100$
4、启动munin-node
service munin-node start
三、收尾
1、监控机测试客户端
在监控机使用telnet命令连接到客户端:
telnet 192.168.1.200 4949
使用list、fetch cpu命令查看能否获得信息。
2、访问http://监控机IP/munin
输入前面设置的用户名和密码登陆。如果验证用户名和密码和后,页面显示Index of munin说明index.html没有生成,看日志是因为没有nodes,检查配置是否有错,ip是不是写错了。
3、其它
监控机会产生四个日志文件,在/var/log/munin目录下:
munin-graph.log
munin-html.log
munin-limits.log
munin-update.log
被监控机产生一个日志文件,同样在/var/log/munin目录下:
munin-node.log
被监控机的插件目录在/etc/munin/plugins目录。
参考资料:
http://blog.zfcms.com/article/458
http://blog.chinaunix.net/uid-15795819-id-3118511.html
http://salogs.com/2011/09/munin-application-notes-installation/
http://www.debian-administration.org/articles/597
http://munin-monitoring.org/wiki/LinuxInstallation
- CentOS Linux安装munin
- munin安装
- linux munin 服务器监控 安装配置
- Linux系统轻量级监控工具monitorix和munin安装
- Linux系统轻量级监控工具monitorix和munin安装
- munin安装使用
- Munin 安装配置
- Centos5.6安装MUNIN
- munin安装方法
- Linux 安装 Master/Node munin-1.4.6 + rrdtool-1.4.5 监控服务运行状态
- Munin监控的安装与配置
- Linux主机监控工具munin monit ntop
- 用Munin监控Linux服务器性能
- 基于CentOS5.x的munin 服务器监控安装配置
- Cagios.sh 自动安装nagios cacti zabbix munin的脚本
- linux centos安装tomcat
- Linux、centos 安装sqlite
- Linux CentOS PhpMyAdmin安装
- php 获取路径的一些方法
- 内存调试 - MEMWATCH
- linux core dump
- 最简单的问题与算法(求最大约数)
- Nagios Web页面提示-CGI乱码如何解决
- CentOS Linux安装munin
- android开发中常用屏幕单位转换
- (转载)linux命令之五十三telnet命令
- Ubuntu下Android开发:手机不能识别
- Makefile选项CFLAGS,LDFLAGS,LIBS
- 2015年中国互联网发展展望(月光博客)
- uva 10285 The Tower of Babylon(记忆化搜索)
- oracle日常检查脚本
- iOS开发的一些奇巧淫技2