CentOS安装Monitorix工具的方法

时间:2015-05-31450举报小编:123

    今天给大家带来了CentOS安装Monitorix工具的教程,希望对大家有所帮助哦!


    安装:

    1、在CentOS下设置一个安装源,便于yum命令的使用

    #vi /etc/yum.repos.d/CentOS-Base.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、使用YUM 安装一下软件

    yum install rrdtool rrdtool-perl perl-libwww-perl perl-MailTools perl-MIME-Lite perl-CGI perl-DBI perl-XML-Simple perl-Config-General perl-HTTP-Server-Simple wget

    3、下一步,使用wget命令,下载最新版本的‘Monitorix’程序包。

    例如:# wget http://www.monitorix.org/monitorix-3.4.0-1.noarch.rpm

    一旦成功下载,使用rpm命令安装它。

    # rpm -ivh monitorix-3.4.0-1.noarch.rpm

    一旦成功安装,请查看一下主配置文件‘/etc/monitorix.conf’,根据你的系统添加一些额外的设置,启用或禁用图形。

    最后,将Monitorix服务添加到系统启动项,并使用下面两个命令来开启这项服务。

    # chkconfig --level 35 monitorix on

    # service monitorix start

    一旦你开启了这项服务,该程序会开始根据‘/etc/monitorix.conf’文件里面的配置集,收集系统信息;几分钟过后,

    你会开始在以下位置,从浏览器看到系统图形:

    http://localhost:8080/monitorix/

    如果你有处于启用状态的SELinux,那么图形看不见,你会在‘/var/log/messages’或‘/var/log/audit/audit.log’文件中看到大量的错误信息,

    这些错误信息显示了访问RRD数据库文件被拒绝。想清除这类错误信息和右见的图形,你就需要禁用SELinux。

    想关闭SELinux,只要在‘/etc/selinux/config’文件中将“enforcing”这一行改成“disabled”。

    SELINUX=disabled

    上面这一更改会临时禁用SELinux,直到你重启机器为止。如果你希望系统总是在禁用模式下开启,就要重启系统。

    要想同时监控多个linux主机 。需要在要每个linux主机上安装“monitorix”,并修改其中一个linux主机的配置文件:monitorix.conf。

    找到并修改成以下内容:

    《multihost》

    enabled = n //将enable改成y

    footer_url = y

    graphs_per_row = 2

    remotehost_list = server 1

    《remotehost_desc》

    1=http://172.16.0.102:8080,/,/ //这里更改为要监控的主机IP地址:

    《/remotehost_desc》

    groups = n

    remotegroup_list = My Group

    《remotegroup_desc》

    0 = server 2, server 3

    《/remotegroup_desc》

    《/multihost》

    上面就是CentOS安装Monitorix的方法介绍了,在安装Monitorix前,需要设置一个安装源,然后再使用wget命令和rpm命令进行下载安装。