监控之Nagios+Nrpe

系统环境:RHEL6 x86_64 selinux and iptables disabled

Nagios主机:172.25.193.2(server端)

Mysql主机: 172.25.193.3(client端)

Server端:

shell> yum install httpd gcc make gd-devel -y#编译所需软件包

shell> useradd nagios                      #运行nagios服务的用户

shell> usermod -G nagios apache         #使 apache 用户对 nagios 目录具有写权限,不然 web 页面操作失败    

shell> tar jxf nagios-cn-3.2.3.tar.bz2           #nagios 软件安装

shell> cd nagios-cn-3.2.3

shell> ./configure

make all

make install

make install-init

make install-commandmode

make install-config

make install-webconf

shell> tar zxf nagios-plugins-2.1.1.tar.gz 

shell> yum install -y mysql-devel openssl-devel

shell> ./configure

shell> make

shell> make install

shell> chown nagios.nagios /usr/local/nagios/

shell> chown -R nagios.nagios /usr/local/nagios/libexec

shell> /etc/init.d/nagios start

shell> htpasswd /usr/local/nagios/etc/htpasswd.users nagiosadmin

shell> cd /usr/local/nagios/etc/objects

shell> cp -p localhost.cfg hosts.cfg

shell> cp -p localhost.cfg services.cfg

shell> vim ./nagios.cfg

shell> vim hosts.cfg

shell> vim services.cfg

Client端

shell>yum install -y mysql-server

shell> /etc/init.d/mysqld start

shell> mysql

mysql>  grant select on test.* to nagios@'172.25.193.2' identified by 'redhat';

shell> ./check_mysql -H 172.25.193.3 -u nagios -p redhat

Server端

shell> /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

shell> /etc/init.d/nagios reload

 

 

 

shell> yum install -y rpm-build

shell> rpmbuild -tb ganglia-3.4.0.tar.gz

 yum install -y libart_lgpl-devel gcc-c++ python-devel libconfuse-devel pcre-devel  autoconf automake libtool expat-devel rrdtool-devel apr-devel

 yum install -y rrdtool-devel-1.3.8-6.el6.x86_64.rpm  

               libconfuse-2.6-3.el6.x86_64.rpm

               libconfuse-devel-2.6-3.el6.x86_64.rpm

shell> rpmbuild -tb ganglia-web-3.4.2.tar.gz

        cd rpmbuild/RPMS/noarch/

rpm -ivh ganglia-web-3.4.2-1.noarch.rpm 

 

Client端:

shell> rpm -ivh  ganglia-gmond-3.4.0-1.x86_64.rpm   libganglia-3.4.0-1.x86_64.rpm 

libconfuse-2.6-3.el6.x86_64.rpm

libconfuse-devel-2.6-3.el6.x86_64.rpm

shell> vim /etc/ganglia/gmond.conf 修改cluster name

Server端:

shell> cd /etc/ganglia

shell> vim gmetad.conf

shell> vim gmond.conf

shell> /etc/init.d/gmetad start

shell> /etc/init.d/gmond/ start

                                                                                                                                                                                                                                 by Yedda

             

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值