手机版
你好,游客 登录 注册
背景:
阅读新闻

RHEL下安装配置Nagios与Cacti服务

[日期:2013-01-05] 来源:Linux社区  作者:yincg [字体: ]

nagios安装指南
环境:rhel6.2
软件:nagios-3.3.1.tar.gz

1、最小化安装系统
2、安装缺失插件
yum install -y httpd http-devel mysql mysql-devel mysql-server gcc glibc glibc-common gd gd-devel php  make php-devel php-gd ntp make  net-snmp net-snmp-devel
3、创建nagios用户并创建nagcmd组,允许用户在web上执行命令.
useradd -m nagios 
 

groupadd nagcmd 
usermod -a -G nagcmd nagios 
usermod -a -G nagcmd apache
3、编译安装nagios
./configure  --with-gd-lib=/usr/local/lib  --with-command-group=nagcmd  --prefix=/var/www/html/nagios
make all
make install
make install-init 
make install-config 
make install-commandmode
4、修改发信邮箱、修改apache配置文件
vi  /var/www/html/nagios/etc/objects/contacts.cfg
nagios-3.2.3/sample-config/httpd.conf中的片段拷贝到/etc/httpd/conf/httpd.conf中
5、添加登录认证文件
htpasswd -c  /var/www/html//nagios/etc/htpasswd.users nagiosadmin 
6、安装nagios-plugins插件
tar -zvxf nagios-plugins-1.4.15.tar.gz
cd nagios-plugins-1.4.15
./configure --with-nagios-user=nagios --with-nagios-group=nagios  --prefix=/var/www/html/nagios
make && make install
7、nagios 测试
chown nagios:nagios /var/www/html/nagios/ -R
/etc/init.d/httpd restart 
chkconfig httpd on 
/etc/init.d/nagios start
8、安装nrpe
tar xzvf nrpe-2.12.tar.gz 
cd nrpe-2.12 


./configure 
make all   
make install-plugin 
make install-daemon 
make install-daemon-config 
make install-xinetd 
9、修改nrpe配置
编辑/etc/xinetd.d/nrpe
only_from = 127.0.0.1 #这里只能加一个IP
编辑/etc/services,在最后一行加上
nrpe 5666/tcp # NRPE


在监控主机上编辑 /var/www/html/nagios/etc/objects/commands.cfg,加入下面的command。
[plain] view plaincopy
define command{ 
        command_name  check_nrpe 
        command_line  $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ 

10、配置snmp服务
yum install net-snmp net-snmp-devel net-snmp-libs net-snmp-utils
chkconfig –level 35 snmpd on
service snmpd start
vi /etc/snmp/snmpd.conf
修改com2sec notConfigUser  default      public
为:com2sec notConfigUser  127.0.0.1      public
修改access  notConfigGroup ""      any      noauth    exact  systemview none none
为access  notConfigGroup ""      any      noauth    exact  all  none none
并启用view all    included  .1                              80此行;

linux
相关资讯       CACTI  Nagios配置 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款