Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2847561
  • 博文数量: 348
  • 博客积分: 2907
  • 博客等级: 中校
  • 技术积分: 2272
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-12 09:16
个人简介

专注 K8S研究

文章分类

全部博文(348)

文章存档

2019年(22)

2018年(57)

2016年(2)

2015年(27)

2014年(33)

2013年(190)

2011年(3)

2010年(14)

分类: LINUX

2013-07-26 01:48:30

原文地址:Nagios 实施步骤 作者:sungm1984

1. apache, php

若是非rpm包安装,在编译安装nagios时注意加上 --with-httpd-conf的参数

2. 安装nagios

新建 nagios用户和nagcmd用户组

nagios和运行apache的用户加入到nagcmd里去

configure

make all

make install

make install-init

make install-config

make install-commandmode

make install-webconf


添加web的管理员账号:

htpasswd -c /usr/local/nagios/etc/htcpasswd.users

chkconfig nagios on

/etc/init.d/nagios start


3.安装nagios-plugin

没什么特别的,编译安装

./configure --prefix=/usr/local/nagios --with-nagios-user=nagios --with-nagios-group=nagios


4. 安装nrpe

需要openssl的支持,所以先安装openssl openssl-devel

./configure

make all

make install-plugin

make install-daemon

make install-daemon-config

make install-xinetd


添加服务端口:

/etc/services

nrpe 5666/tcp #nrpe


chkconfig nrpe on

/etc/init.d/xinetd restart


到此nagios服务器端安装完毕


5. 被监控系统安装 nagios-plugin nrpe

安装同上

最后在/etc/xinetd.d/nrpe 添加

 only_from = 127.0.0.1 nagios_ip

 

6 配置nagios

创建 hosts.cfg hostgroup.cfg service.cfg Define config files' depend yourself


service.cfg 定义的服务里

check_command check_nrpe!check_load


这里的check_load是定义在被监控系统上的


是在 被监控系统的/usr/local/nagios/etc/nrpe.cfg 中定义的


command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20

阅读(1335) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~