ImageVerifierCode 换一换
格式:DOCX , 页数:16 ,大小:19.71KB ,
资源ID:22378655      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/22378655.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(Centos56下的Nagios详细配置之三nagios监控linux主机Word文件下载.docx)为本站会员(b****7)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

Centos56下的Nagios详细配置之三nagios监控linux主机Word文件下载.docx

1、host -n -u -p -t -c 使用方式:check_nrpe -H 主机名 -p NRPE端口 -c NRPE命令名 Options:选项: = The address of the host running the NRPE daemon 主机,运行着NRPE守护进程的远程被监测主机名,并且该主机名必须在host里定义过。 port = The port on which the daemon is running (default=5666) 端口,被监测的远程主机上运行NRPE的端口,默认是5666,如果是默认就不用指定。 command = The name of the c

2、ommand that the remote daemon should run 命令,这些命令名必须是被监测主机上NRPE守护进程运行着的。查看监控服务器是否能和远程Linux 192.168.1.3正常通信。能正常通信返回 NRPE的版本号rootKCentOS5C #/usr/local/nagios/libexec/check_nrpe H 192.168.1.32.在command.cfg命令定义文件中添加NRPE命令。rootKCentOS5C # vi /usr/local/nagios/etc/objects/commands.cfg添加如下NRPE功能命令# NRPE Com

3、manddefine command command_name check_nrpe command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ 这里要说明几点:(1)这里定义的命令名就叫作nrpe。(2)$USER1$/check_nrpe会通过引用resource.cfg获得/usr/local/nagios/libexec/check_nrpe这个绝对路径。(3)-H $HOSTADDRESS$ 用来获得指定被监测主机的IP地址,$HOSTADDRESS$变量会通过定义主机名查找到host段中的IP地址。(4)-c $ARG1$

4、用来指定被监测主机上NRPE守护进程运行着的NRPE命令名。3.在Nagios监控服务器上然后按照NRPE命令定义来添加NRPE远程监控服务:#vi /usr/local/nagios/etc/objects/localhost.cfg在localhost.cfg 添加 define host define servicedefine hostuse linux-serverhost_name mylinuxalias mylinux address 192.168.1.3 ;远程Linux服务器的地址define service use generic-service host_name m

5、ylinux service_description check-swap /对下面操作的描述 check_command check_nrpe!check_swap /执行检测交换分区命令,监控swap service_description check-loadcheck_load /监控负载 service_description check-diskcheck_disk /监控硬盘 service_description check-userscheck_users /监控用户(使用)情况 service_description total_procscheck_total_procs

6、 /监控进程运行如下命令。如果没有错误就可以重启Nagios 服务# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg重启 Nagios Service 使配置生效# service nagios reload监控主机和被监控主机如果启动Iptables防火墙的话,测试的时候可以停止iptables服务 Service iptables stop 正真的使用中,需要开启Iptables,同时配置防火墙是Iptables 的5666端口开放。防火墙配置方法:/sbin/iptables -A FORWARD -i e

7、th0 -p tcp -dport 5666 -j ACCEPT (三)在被监控主机上安装Nagios-plugins插件程序:(下载地址1.添加Nagios用户# useradd nagios安装软件包:yum -y install gcc openssl-devel openssl2.下载插件#mkdir /downloads3.准备好Nagios-plugins和NRPE源代码包# lltotal 2008-rw- 1 root root 928 Oct 3 10:33 anaconda-ks.cfg-rw-r-r- 1 root root 22760 Oct 3 10:33 insta

8、ll.log-rw-r-r- 1 root root 2888 Oct 3 10:33 install.log.syslog-rw-r-r- 1 root root 1693979 Sep 30 22:51 nagios-plugins-1.4.15.tar.gzNagios-plugins插件程序包-rw-r-r- 1 root root 305019 Sep 30 22:58 nrpe-2.13.tar.gzNRPE扩展插件功能包4.解压Nagios-plugins压缩包# tar -zxvf nagios-plugins-1.4.15.tar.gz5.进入Nagios-plugins插件

9、包目录# cd nagios-plugins-1.4.156.预配置Nagios-plugins的安装路径# ./configure -prefix=/usr/local/nagios如提示出错请安装以下软件包:yum install gccyum install glibc glibc-commonyum install gd gd-develyum -y install openssl openssl-devel预配置完成后会反馈信息并生成Makefileconfig.status: creating po/Makefile -with-apt-get-command: -with-pin

10、g6-command: /bin/ping6 -n -U -w %d -c %d %s -with-ping-command: /bin/ping -n -U -w %d -c %d %s -with-ipv6: yes -with-mysql: no -with-openssl: -with-gnutls: -with-perl: /usr/bin/perl -enable-perl-modules: -with-cgiurl: /nagios/cgi-bin -with-trusted-path: /bin:/sbin:/usr/bin:/usr/sbin7.编译Nagios-plugin

11、s插件程序# make8.安装Nagios-plugins插件程序# make install9.查看Nagios-plugins插件程序的安装# ll /usr/local/nagios/total 8drwxr-xr-x 2 root root 4096 Oct 7 01:02 libexecdrwxr-xr-x 3 root root 4096 Oct 7 01:02 share10.递归更改Nagios主路径的属主# chown nagios.nagios /usr/local/nagios/# chown -R nagios.nagios /usr/local/nagios/libe

12、xec11.检查Nagios主路径的属性# ll /usr/local/ | grep nagiosdrwxr-xr-x 4 nagios nagios 4096 Oct 7 01:02 nagiosrootKCentOS5A # ll /usr/local/nagios/drwxr-xr-x 2 nagios nagios 4096 Oct 7 01:drwxr-xr-x 3 nagios nagios 4096 Oct 7 01:(四)再在被监控主机上安装NRPE扩展插件程序:(下载地址:1.下载插件原因缺少openssl-devel包,解决办法安装:yum install xinetd

13、2.解压NRPE的压缩包# tar -zxvf nrpe-2.13.tar.gz# cd nrpe-2.13 3.预配置NRPE安装程序# ./configure (-enable-ssl -with-ssl-lib=/lib/) 预配置完毕后会反馈提示信息以及建立Makefileconfigure: creating ./config.status creating Makefile creating src/Makefile creating subst creating include/config.h* Configuration summary for nrpe 2.9 08-13-

14、2007 *: General Options: - NRPE port: 5666 NRPE user: nagios NRPE group: Nagios user: Nagios group:Review the options above for accuracy. If they look okay,type make all to compile the NRPE daemon and client.最后提示继续使用“make all”命令来对NRPE守护程序以及客户端程序进行编译。4.对NRPE程序进行编译# make all编译成功后会反馈提示信息* Compile finis

15、hed *If the NRPE daemon and client compiled without any errors, youcan continue with the installation or upgrade process.Read the PDF documentation (NRPE.pdf) for information on the nextsteps you should take to complete the installation or upgrade.在NRPE的包目录中有一份NRPE.pdf的手册,接下来就可以参考那份手册进行后续的操作了。安装NRPE

16、插件程序,守护程序以及模板守护程序配置文件。Install the NRPE plugin (for testing), daemon, and sample daemon config file.5.安装NRPE插件程序# make install-plugin6.安装NRPE守护程序# make install-daemon7.安装NRPE守护程序配置文件# make install-daemon-config8.检查NRPE程序的安装total 16drwxrwxr-x 2 nagios nagios 4096 Oct 7 01:16 bin16 etc15 libexec9. 安装Xi

17、netd 相关配置文件# make install-xinetd10.相关文件的修改#vim /usr/local/nagios/etc/nrpe.cfg allowed_host=192.168.1.2 127.0.0.1 /允许192.168.1.2对其监控(不同地址间加空格)# vi /etc/services 文件作如下修改:nrpe 5666/tcp # NRPE# service xinetd restart替代:(如发现异常,或者更改了配置,用此方法重启下nrpe进程,也许可解决)# ps aux | grep nrpe# kill nagios的进程号#/usr/local/n

18、agios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d#tail /var/log/messages(查看nrpe日志,是否成功)#killall -9 nrpe(五)在被监测主机上配置并运行NRPE1.配置NRPE的主配置文件usr/local/nagios/etc/nrpe.cfg 配置文件默认就可以了。2.找到NRPE运行的执行程序# ll /usr/local/nagios/bin/nrpe-rwxrwxr-x 1 nagios nagios 93420 Oct 7 01:16 /usr/local/nagios/bin/nrpe3.了解

19、NRPE的执行程序的使用方式# /usr/local/nagios/bin/nrpe -h nrpe -n -c mode运行方法:nrpe -c NRPE配置文件路径 运行模式可用选项 -n = Do not use SSL 不使用SSL方式,一般都使用SSL。 = Name of config file to use 指定NRPE配置文件路径,这个NRPE主配置文件就是nrpe.cfg。 = One of the following two operating modes: 指定NRPE的运行方式,一共有2种可用的NRPE运行方式: -i = Run as a service under

20、inetd or xinetd 以超级守护进程inetd或xinetd方式运行NRPE,要通过这种方式运行的话还要安装和配置xinetd,一般不用。 -d = Run as a standalone daemon 以独立守护进程方式运行NRPE,一般常用这种运行方式。4.运行NRPE守护进程# /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d测试NEPE本地是否正常启动#/usr/local/nagios/libexec/check_nrpe H localhost如果正确的话,回返回NRPE的版本号Error could not complete ssl hanshake如果配置没有问题的话,输入如下命令。查看配置是否配好# netstat -at | grep nrpetcp 0 0 *:nrpe *:* LISTEN5.查看系统日志检查NRPE运行情况:# tail /var/log/messagesOct 7 01:45:10 KCentOS5A nrpe21659: Starting up daemon说明已经顺利启动了NRPE守护进程。 Listening for connections on port 5666说明已经启动了5666端口为NRPE的监听端口。

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1