开发工具:
文件大小: 735kb
下载次数: 0
上传时间: 2019-07-02
详细说明:Nagios是一款开源的免费网络监视工具,能有效监控Windows、Linux和Unix的主机状态,交换机路由 器等网络设置,打印机等。在系统或服务状态异常时发出邮件或短信报警第一时间通知网站运维人员,在 状态恢复后发出正常的邮件或短信通知。glibc-common-2,12-1.132.e/6.X86 64
gd-2.0.35-11.e/6.X8664
gd-deve}-2.0.35-11.e/6.x8664
xinetd-2.3.14-39.e64.X8664
openss}-aeve-1.O.1e-16.e165,7,x8664
4. Nagios安装
4.1创建 nagIos用户和密码(所有主从节点)
useradd nagios -d/usr/local/nagios
passwd nagios
42安装 nagios主程序(所有主从节点都要安装)
yum Install nag/os
43安装 nagios:插件(所有节点安装
安装所有插件
yum install nagios-plugins-all
也可以按照需要选择安装某些插件,例如
yum install nagios-plugins-nagios nagios-plugins-oad nagios-plugins-smtp
将 nagIos添加为服务
chkconfig --add nagios
chkconfig nagios off
chkconfig --level 35 nagios on
chkconfig --list nagios
nagios 0: off 1: off 2: off 3: on 4: off 5: on 6: off
44安装NRPE(所有节点安装
yum install nrpe
4.4,1被监控节点NREP配置
如果是被监控节点需要配置ηrpe已守护进程运行(通过 xinetd来运行)
更改/etc/ xinetd.d/nrpe文件,设置允许 nagIos主节点服务器连接
vi/etc/xinetd. d/nrpe
修改on/fom参数,添加 lagos主形点版务器P
service nrpe i
flags = REUSE
socket_ type= stream
port
5666
wait no
user nagios
group nagios
server =/usr/sbin/nrpe
serverargs =-c/etc/nagios/nrpe. cfg --inetd
log on failure + USERID
disable no
on/_ from=127.0.0.1172.18.108.104
修改/etc/ services
vi/etc/services
-在结尾增加
nrpe 5666/tcp NRPE
增加对参数的支持
i /etcnagios/nrpe. cfg
修改 dont blame nrpe参数
dont_ blame_ nrpe=1
启动 xinetd
service xinetd restart
45安装 Apache(主节点安装)
uminstallhttpd
46安装PHP(主节点安装)
yum install php
47通过 Apache发布 Ganglia-web(主节点安装
vi/etchttpd/conf/httpd.conf
-在最后增加如下容
#setting for nagios
ScriptAlias /nagios/cgi-bin /usr/ib64/nagios/cgi-bin
AuthType Basic
Options ExeccGI
AllowOverride None
Order allow, deny
Allow from all
AuthName "Nagios Access
AuthUserFile /etc/nagios/passwd
Require valid-user
Alias /nagios "/usr/share/nagios
Auth Type Basic
Options None
A∥ OVerride none
Order allow, deny
A∥ w from a∥
AuthName "nagios Access
AuthUserFile /etc/nagios/passwd
Require valid-user
为Web访问时添加用户名和密码(此处用户名为 admin,可自定义)
htpasswd -c/etc/nagios/passwd admin
启动 apache
servicehttpdrestart
5.配置 Nagios
5.1检查监控命令
/usr/ib64/nagios/plugins/check_ users -a 5 10
/usr/ib64/nagios/plugins/checkload -a 15, 10,530, 25,20
usr/ib64nagios/plugins/check disk -a 20%010%0/
/usr/ib64/nagios/plugins/check_procs -a 200 400 RSZDT
/usr/1b64/nagios/plugins/check_ swap -a 20%010%0
5.2配置监控服务主节点
修改 nagIos配置文件cgi.cfg
vi/etc/nagios/cgi. cfg
修改如下容,为dmin用户增加权假
default user name=admin
authorized for system information =nagiosadmin, admin
authorized for configuration information =nagiosadmin, admin
authorized for system commands=nagiosadmin, admin
authorized for all services=nagiosadmin, admin
authorizedfor-allhosts=nagiosadmin, admin
authorized for all service commands=nagiosadmin, admin
authorizedfor-allhost commands=nagiosadmin, admin
修改 nagIos配置文件 nag lOs.cfg
vi/etc/nagios/nagios. cfg
取消下面配置文件路经的注释
cfg dir=/etc/nagios/conf. d
53定义监控的主机组
声明一个监控的主机组,将主机环境中提到的四台主机全部加入监控。
vi /etc/nagios/conf. d/group. cfg
define hostgroupt
hostgroup name bigdata-cluster
alias bidata cluster
members bigdata101, bigdata102, bigdata103, bigdata104
hostgroup_ name:主机组的名称,可随意指定
alias:主机组别名,可随意指定。
members:主机组成员,多个主机名称之前使用逗号分隔。另外主机名称必须与 define hosti中的
host name-致。
54定义本监控的所有主机
以 biodata101为例:
vi/etc/nagios/ conf, d/bigdata101 cfg
define host
use linux-server
host name biodata 101
alias bigdata101
address172,18,108.101
define service
use loca/-service
host_ name bigdata101
service description Users
check command check ocal users/ 20150
define servicei
use ocal-service
host_ name biodata 101
service description CPU
check command check / ocal load 5.0, 4,0,3.0/10,0,6.0, 4.0
define service
use local-service
host name bigdata101
service description Disk Root
check command check /oca/ disk 20%o!10%0
define service
use local-service
host name biodata 101
service description Zombie procs
check command check /oca/ procs 5!10!Z
define service
use local-service
host name bigdata101
service_ description Total Procs
check command check_/oca/procs/250!400/RSZDT
define servicei
use oca/-service
host name bigdata101
service description Swap Usage
check_ command check_/ocal swap!20110
55定义邮件监控
/etc/nagios/objects/ contacts. cfg
define contact
contact_ name nagiosadmin Short name of user
use generic-contact Inherit default values from generic-contact template(defined
above)
alias Nagios Admin i Full name of user
(系统自动生成,下载前可以参看下载内容)
下载文件列表
相关说明
- 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
- 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。
- 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
- 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
- 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
- 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.