Nagios安装与配置详解

合集下载

nagios监控mysql详细配置

nagios监控mysql详细配置

Nagios监控mysql工作原理利用特定的用户定期访问指定的mysql数据库。

当不能访问或连不通时则报警。

配置过程如下1、在生产库上安装nagios插件,以nagios-plugins-1.4.15为例来讲述整个配置过程进入nagios-plugins-1.4.15 目录./configure 编译然后是编译完显示一定要有mysql支持,不然没有check_mysql这个插件config.status: creating po/Makefile--with-apt-get-command:--with-ping6-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: /usr/bin/mysql_config--with-openssl: yes--with-gnutls: no--enable-extra-opts: no--with-perl: /usr/bin/perl--enable-perl-modules: no--with-cgiurl: /nagios/cgi-bin--with-trusted-path: /bin:/sbin:/usr/bin:/usr/sbin--enable-libtap: noMake all&&make install插件安装完毕再安装nrpe 安装过程略同时是编译安装三步曲:./configure make make install2、配置mysqlmysql> create database nagios; //建立nagios专用数据Query OK, 1 row affected (0.00 sec)mysql> grant select on nagios.* to nagios@'%' identified by '######'; //建立nagios专用用户权限只给select就OK,给多了不安全。

Nagios安装配置手册

Nagios安装配置手册

12.配置和启动 nagios cd /usr/local/nagios/etc 里面如果有 cfg-sample,就把目录里的.cfg-sample 文件全部拷贝成.cfg 例如: cp nagios.cfg-sample nagios.cfg 没有的话就直接修改:
修改 vi cgi.cfg, use_authentication=1 改成 use_authentication=0, 即不用验证.不然有一些页面不会显示。
情况二: 如果还不行,从这个网站: 下载一下 Mudule 包,tar.gz 格式的! - Crypt::DES - Digest::MD5 - Digest::SHA1 - Digest::HMACcd - Net::SNMP 按以下操作顺序安装这些 Module: tar zxf <module>.tar.gz cd <module> perl Makefile.PL make test make install 完了以后 cd nagios_plugins ./install.sh (路径选默认,y/n 选 Y!)
6.安装 nagios nagios 之前的准备,特别需要安装 gd-devel, 另外安装 nagios 时需要加--with-gd-lib=/usr/lib --with-gd-inc=/usr/include 不然不能生成 statusmap.cgi 也就不能看状态图了!
groupadd nagios useradd -g nagios nagios passwd nagios mkdir /usr/local/nagios chown -R nagios:nagios /usr/local/nagios chmod 755 /usr/local/nagios/ usermod -G nagios apache usermod -G nagios nagios grep ^User /etc/httpd/conf/httpd.conf User apache 查看运行 apache 的用户

nagios安装及配置完整成功案例

nagios安装及配置完整成功案例

一、Nagios简介Nagios是一款开源的电脑系统和网络监视工具,能有效监控Windows、Linux和Unix 的主机状态,交换机路由器等网络设置,打印机等。

在系统或服务状态异常时发出邮件或短信报警第一时间通知网站运维人员,在状态恢复后发出正常的邮件或短信通知。

Nagios原名为NetSaint,由Ethan Galstad开发并维护至今。

NAGIOS是一个缩写形式: "Nagios Ain't Gonna Insist On Sainthood" Sainthood 翻译为圣徒,而"Agios"是"saint"的希腊表示方法。

Nagios被开发在Linux下使用,但在Unix下也工作得非常好。

主要功能•网络服务监控(SMTP、POP3、HTTP、NNTP、ICMP、SNMP、FTP、SSH)•主机资源监控(CPU load、disk usage、system logs),也包括Windows主机(使用NSClient++ plugin)•可以指定自己编写的Plugin通过网络收集数据来监控任何情况(温度、警告……)•可以通过配置Nagios远程执行插件远程执行脚本•远程监控支持SSH或SSL加通道方式进行监控•简单的plugin设计允许用户很容易的开发自己需要的检查服务,支持很多开发语言(shell scripts、C++、Perl、ruby、Python、PHP、C#等)•包含很多图形化数据Plugins(Nagiosgraph、Nagiosgrapher、PNP4Nagios等)•可并行服务检查•能够定义网络主机的层次,允许逐级检查,就是从父主机开始向下检查•当服务或主机出现问题时发出通告,可通过email, pager, sms 或任意用户自定义的plugin进行通知•能够自定义事件处理机制重新激活出问题的服务或主机•自动日志循环•支持冗余监控•包括Web界面可以查看当前网络状态,通知,问题历史,日志文件等二、Nagios工作原理Nagios的功能是监控服务和主机,但是他自身并不包括这部分功能,所有的监控、检测功能都是通过各种插件来完成的。

nagios3.3.1详细安装

nagios3.3.1详细安装

操作系统centos6.0 (只选择的Xwindows-ked-开发工具)所需软件通过yum安装部分所需要软件yum -y install gcc glibc glibc-common gd gd-devel mailx sendmailApache安装tar zxvf httpd-2.2.21.tar.gzcd httpd-2.2.21./configure --prefix=/usr/local/apachemakemake install将/usr/local/apache/bin/apachectl start加到rc.localphp安装(安装前需要先安装yum install libxml2-devel)cd php-5.2.17./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-gd makemake installln -s /usr/local/php/bin/* /usr/local/bin/cp php.ini-dist /usr/local/php/lib/php.ini配置PHP(1)查看是否有LoadModule php5_module modules/libphp5.so这一行(2)# vi /usr/local/apache/conf/httpd.conf找到#AddType application/x-gzip .gz .tgz 这行,在下面加两行AddType application/x-httpd-php .phpAddType application/x-httpd-php-source .phps找到下面一行在后面加上index.php,这表示网站的默认页也能够为index.php DirectoryIndex index.html index.htm index.php index.cgi二、安装配置nagios1创建系统账号# /usr/sbin/useradd -m nagios# passwd nagios# /usr/sbin/groupadd nagcmd# /usr/sbin/usermod -a -G nagcmd nagios# /usr/sbin/usermod -a -G nagcmd apache (编译安装没有apache用户)2安装配置nagios-core#./configure --prefix=/usr/local/nagios --with-command-group=nagcmd#make all#make install#make install-init#make install-config#make install-commandmode# make install-webconf (apache安装这步执行不成功)安装插件tar -zxvf nagios-plugins-1.4.15.tar.gzcd nagios-plugins-1.4.15./configure --prefix=/usr/local/nagios --with-nagios-user=nagios --with-nagios-group=nagios makemake install新增用于WEB登陆的用户/usr/local/apache/bin/htpasswd -c /usr/local/nagios/etc/ers nagiosadmin如果新建的用户名不是nagiosadmin那么就需要在/usr/local/nagios/etc/cgi.cfg中以下行添加该用户authorized_for_system_information=nagiosadminauthorized_for_configuration_information=nagiosadminauthorized_for_system_commands=nagiosadminauthorized_for_all_services=nagiosadminauthorized_for_all_hosts=nagiosadminauthorized_for_all_service_commands=nagiosadminauthorized_for_all_host_commands=nagiosadmin配置WEB接口vi /usr/local/apache/conf/httpd.conf后面添加ScriptAlias /nagios/cgi-bin /usr/local/nagios/sbin<Directory "/usr/local/nagios/sbin">Options ExecCGIAllowOverride NoneOrder allow,denyAllow from allAuthName "Nagios Access"AuthType BasicAuthUserFile /usr/local/nagios/etc/ersRequire valid-user</Directory>Alias /nagios /usr/local/nagios/share<Directory "/usr/local/nagios/share">Options NoneAllowOverride NoneOrder allow,denyAllow from allAuthName "Nagios Access"AuthType BasicAuthUserFile /usr/local/nagios/etc/ersRequire valid-user</Directory>重新启动Apache服务检查nagios配置文件是否有错误/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg安装nrpe报checking for SSL... configure: error: Cannot find ssl librariesyum install openssl-develtar xzf nrpe-2.8.1.tar.gzcd nrpe-2.8.1./configuremake allmake install-plugin (监控机安装到这一步就可以了)make install-daemonmake install-daemon-config需要修改/usr/local/nagios/etc/nrpe.cof。

nagios全攻略(二)----基本安装和配置

nagios全攻略(二)----基本安装和配置

二. 基本安装和配置本部分主要参考官方文档和田逸的文章<<看我出招之:我用Nagios(技术细节)来修改完成.>>最后达到如下的功能监控机自身的信息,包括主机信息以及对外提供的服务被监控机对外提供的服务如下所有的操作都在监控机192.168.0.111上进行1.安装nagios主程序解压缩tar -zxvf nagios-2.9.tar.gzcd nagios-2.9编译,指定安装目录为/usr/local/nagios./configure --prefix=/usr/local/nagios输出如下信息*** Configuration summary for nagios 2.9 04-10-2007 ***:General Options:-------------------------Nagios executable: nagiosNagios user/group: nagios,nagiosCommand user/group: nagios,nagiosEmbedded Perl: noEvent Broker: yesInstall ${prefix}: /usr/local/nagiosLock file: ${prefix}/var/nagios.lockInit directory: /etc/rc.d/init.dHost OS: linux-gnuWeb Interface Options:------------------------HTML URL: [url]http://localhost/nagios/[/url]CGI URL: [url]http://localhost/nagios/cgi-bin/[/url] Traceroute (used by WAP): /usr/sbin/tracerouteReview the options above for accuracy. If they look okay,type 'make all' to compile the main program and CGIs.make all输出如下信息*** Compile finished ***If the main program and CGIs compiled without any errors, youcan continue with installing Nagios as follows (type 'make'without any arguments for a list of all possible options):make install- This installs the main program, CGIs, and HTML files使用make install来安装主程序,CGI和HTML文件make install-init- This installs the init script in /etc/rc.d/init.d使用make install-init在/etc/rc.d/init.d安装启动脚本make install-commandmode- This installs and configures permissions on thedirectory for holding the external command file使用make install-commandmode来配置目录权限make install-config- This installs *SAMPLE* config files in /usr/local/nagios/etcYou'll have to modify these sample files before you canuse Nagios. Read the HTML documentation for more infoon doing this. Pay particular attention to the docs onobject configuration files, as they determine what/howthings get monitored!使用make install-commandmode来安装示例配置文件,安装的路径是/usr/local/nagios/etc. *** Support Notes *******************************************If you have questions about configuring or running Nagios,please make sure that you:- Look at the sample config files- Read the HTML documentation- Read the FAQs online at [url]/faqs[/url]before you post a question to one of the mailing lists.Also make sure to include pertinent information that couldhelp others help you. This might include:- What version of Nagios you are using- What version of the plugins you are using- Relevant snippets from your config files- Relevant error messages from the Nagios log fileFor more information on obtaining support for Nagios, visit:[url]/support/[/url]*************************************************************Enjoy.很多人都不注意安装过程中的输出信息,直到make install出错了才到处找人求救,而实际上输出的内容包含很多有价值的信息,例如安装路径,版本,每一步做什么,接下来的步骤等.尤其是输出的最后一屏信息,我个人建议好好的读一下.例如上面就列出了很多有价值的信息,我们只需要按照他说的做就行了.安装make install输出如下错误cd ./base && make installmake[1]: Entering directory `/home/yahoon/nagios/nagios-2.9/base'make install-basicmake[2]: Entering directory `/home/yahoon/nagios/nagios-2.9/base'/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/bin/usr/bin/install: invalid user `nagios' 非法用户nagiosmake[2]: *** [install-basic] Error 1make[2]: Leaving directory `/home/yahoon/nagios/nagios-2.9/base'make[1]: *** [install] Error 2make[1]: Leaving directory `/home/yahoon/nagios/nagios-2.9/base'make: *** [install] Error 2按照文档说明增加用户,修改权限[root@localhost nagios-2.9]# useradd nagios[root@localhost nagios-2.9]# mkdir /usr/local/nagios[root@localhost nagios-2.9]# chown nagios.nagios /usr/local/nagios 查看目录权限[root@localhost nagios-2.9]# ll /usr/localdrwxr-sr-x 2 nagios nagios 4096 Jul 10 11:14 nagios看到nagios目录的权限已经被正确修改了重新执行make install输出信息如下*** Main program, CGIs and HTML files installed ***You can continue with installing Nagios as follows (type 'make'without any arguments for a list of all possible options):make install-init- This installs the init script in /etc/rc.d/init.dmake install-commandmode- This installs and configures permissions on thedirectory for holding the external command filemake install-config- This installs *SAMPLE* config files in /usr/local/nagios/etcYou'll have to modify these sample files before you canuse Nagios. Read the HTML documentation for more infoon doing this. Pay particular attention to the docs onobject configuration files, as they determine what/howthings get monitored!make[1]: Leaving directory `/home/yahoon/nagios/nagios-2.9'执行如下命令来安装脚本make install-init执行make install-commandmode输出信息如下/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/var/rw chmod g+s /usr/local/nagios/var/rw*** External command directory configured ***You can continue with installing Nagios as follows (type 'make'without any arguments for a list of all possible options):make install-config- This installs *SAMPLE* config files in /usr/local/nagios/etcYou'll have to modify these sample files before you canuse Nagios. Read the HTML documentation for more infoon doing this. Pay particular attention to the docs onobject configuration files, as they determine what/howthings get monitored!执行make install-config输出信息如下/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/etc/usr/bin/install -c -m 664 -o nagios -g nagios sample-config/nagios.cfg /usr/local/nagios/etc/nagios.cfg-sample/usr/bin/install -c -m 664 -o nagios -g nagios sample-config/cgi.cfg /usr/local/nagios/etc/cgi.cfg-sample/usr/bin/install -c -m 660 -o nagios -g nagios sample-config/resource.cfg /usr/local/nagios/etc/resource.cfg-sample/usr/bin/install -c -m 664 -o nagios -g nagios sample-config/template-object/localhost.cfg /usr/local/nagios/etc/localhost.cfg-sample/usr/bin/install -c -m 664 -o nagios -g nagios sample-config/template-object/commands.cfg /usr/local/nagios/etc/commands.cfg-sample*** Sample config file installed ***Remember, these are *SAMPLE* config files. You'll need to readthe documentation for more information on how to actually defineservices, hosts, etc. to fit your particular needs.If you have questions about configuring Nagios properly, please:- Look at the sample config files- Read the HTML documentation- Read the FAQs online at [url]/faqs[/url]*BEFORE* you post a question to one of the mailing lists.验证程序是否被正确安装。

Nagios监控Linux主机(NRPE安装与应用)

Nagios监控Linux主机(NRPE安装与应用)

Nagios监控Linux主机(NRPE安装与应用)一、NRPE简介及工作原理NRPE是nagios的一个扩展,它被用于被监控的服务器上,向nagios监控平台提供该服务器的一些本地的情况。

例如,cpu负载、内存使用、硬盘使用等等。

NRPE可以称为nagios 的for linux 客户端。

NRPE 由两个部分组成:工作在监控机一侧的check_nrpe 插件、工作在被监控机一侧的NRPE 守护进程。

Nagios 服务器执行check_nrpe 插件并告诉他检查哪个服务,check_nrpe 插件通过SSL 连接方式联系远程服务器上的NRPE 守护进程,NRPE 守护进程执行相应的插件完成指定的检查,并返回结果。

工作原理是:插件nrpe在被监控机上开启一个daemon,通过这个daemon来和监控主机建立一条ssl加密通道,通过这条通道来传送被监控机的本地信息,达到监控的目的。

装在被监控机上的daemon就相当于一个nagios的传递员,命令行从nagios监控主机发出,然后daemon接受到信息,就会执行这条命令行,执行的方式,其实是和nagios主机是一样的,所以被监控机上也需要装一套nagios-plugins插件。

例如:nagios主机需要监控被监控机的硬盘信息,就会对被监控机发出一条命令说:“我要看你的硬盘信息。

”被监控机nrpe的daemon接到这个命令之后,就会运行一个插件,来检查被监控机本地硬盘的信息,然后插件把信息反馈到nrpe,nrpe通过ssl通道再把这些信息反馈到nagios主机。

如下图所示二、NRPE安装1、所需安装包nrpe、nagios-plugins,这两个包都可以从上得到,本例为nrpe-2.12.tar.gz2、安装openssl、openssl-devel;yum install -y opensslyum install -y openssl-devel3、安装nrpe和nagios-plugins插件1)安装nagios-plugins,在安装时首先在被监控机上新建nagios用户及组。

适用于 Nagios Core 的 Dell OpenManage 插件版本 1.0 安装指南说明书

适用于 Nagios Core 的 Dell OpenManage 插件版本 1.0 安装指南说明书

适用于 Nagios Core 的 Dell OpenManage 插件版本 1.0安装指南12021 4注意、小心和警告:“注意”表示帮助您更好地使用该产品的重要信息。

:“小心”表示可能会损坏硬件或导致数据丢失,并告诉您如何避免此类问题。

:“警告”表示可能会导致财产损失、人身伤害甚至死亡。

© 2015 - 2021 Dell Inc. 或其子公司。

保留所有权利。

Dell、EMC 和其他商标是 Dell Inc. 或其附属机构的商标。

其他商标可能是其各自所有者的商标。

章 1: 适用于 Nagios Core 的 Dell OpenManage 插件版本 1.0 简介 (4)章 2: 系统要求 (5)管理系统的系统要求 (5)受管系统的系统要求 (5)章 3: 下载并安装适用于 Nagios Core 的 Dell OpenManage 插件版本 1.0 (6)章 4: 卸载适用于 Nagios Core 的 Dell OpenManage 插件版本 1.0 (8)章 5: 访问 Dell EMC 支持网站上的支持内容 (9)章 6: 相关说明文件 (10)目录3适用于 Nagios Core 的 Dell OpenManage 插件版本 1.0 简介本指南提供了有关适用于 Nagios Core 的 Dell OpenManage 插件版本 1.0 的软件要求、系统要求以及安装和卸载步骤的信息。

通过使用 Integrated Dell Remote Access Controller (iDRAC) with Lifecycle Controller (LC),本插件能够在数据中心内通过无代理方法监测第 12 代及以后各代 Dell PowerEdge 服务器。

本插件提供的功能如表 1 中所述。

表. 1: 主要特性特性功能设备查找使用无代理监测方法,通过 iDRAC with LC 查找第 12 代及以后各代 Dell PowerEdge服务器。

NAGIOS手册

NAGIOS手册

Nagios配置学习手记-续-完整版2005.06.01chnl@目录目录 (2)一、前言 (5)二、安装 (6)(一)Nagios 端 (6)1、安装文件列表 (6)2、安装账号及目录 (6)3、其他 (7)(二)Nrpe 端 (7)1、nrpe的安装 (7)三、配置 (8)(一)Nagios 部分 (8)1、nagios.cfg (8)2、minimal.cfg (10)3、resource.cfg (12)4、cgi.cfg (12)5、commands.cfg (13)6、hosts.cfg (15)7、services.cfg (20)(二)Httpd (Apache )部分 (28)1、nagios.conf (28)2、.htaccess (29)3、ers (29)(三)Nrpe 部分 (30)1、nrpe.cfg (30)四、Notify 脚本 (31)(一)Email 通知部分 (31)1、EmailSend.jar (31)2、EmailNotify.cfg (31)3、dest.addr (32)(二)QQ通知部分 (32)1、TextQQ (32)2、QqNotify.cfg及dest.qq (33)3、qq.sh及qq.exp (33)(三)alert_sender.sh 部分 (34)1、脚本内容 (34)2、简单说明 (37)五、启动 (38)1、Nrpe (38)2、Nagios (38)3、Httpd(Apache) (38)六、使用及测试 (39)1、登陆 (39)2、功能截图 (40)3、测试 (43)附录: (43)Nagios部分: (43)Httpd部分: (44)Nrpe部分: (44)Notify部分: (44)说明本文是上一篇文章<N agios配置学习手记>的后续版本。

主要内容为对command(plugins)/host/service的配置及对主机/应用监控具体实现。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

Nagios学习笔记之(一)最初搭建 2012-07-17 13:05:08 标签:linux 监控 nagios cacti 声明:原创作品,如需,请与作者联系。否则将追究法律责任。 Nagios学习笔记之一最初搭建

一、简介: Nagios是一款开源的免费网络监视工具,能有效监控Windows、Linux和Unix的主机状态,交换机路由器等网络设置,打印机等。在系统或服务状态异常时发出或短信报警第一时间通知运维人员,在状态恢复后发出正常的或短信通知。

二、搭建过程:

OS: CentOS 5.5 x86_64(最小化即可) Nagios主程序: nagios-cn-3.4.1 Nagios插件: nagios-plugins-1.4.15.tar.gz

2.1安装前: 2.1.1安装依赖包,下载源程序包 1. #cd /etc/yum.repos.d/ 2. #rm -fr ./* 3. #wget wget mirrors.163./.help/CentOS-Base-163.repo 4. #yum makecache

#删除系统自带的yum源,下载网易的网络源并更新缓存 1. #yum -y install gcc glibc glibc-common gd gd-devel httpd

#安装必须的依赖包 1. #wget prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.4.1.tar.gz 2. #wget prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.15.tar.gz #下载nagios主程序以及插件程序 2.1.2正式安装: 1. #groupadd nagcmd 2. #useradd -G nagcmd nagios 3. #usermod -G nagcmd apache

#创建一个用户组名为nagcmd用于从Web接口执行外部命令。将nagios用户和apache用户都加到这个组

中。 1. #tar zxf nagios-3.4.1.tar.gz 2. #cd nagios 3. #./configure --prefix=/usr/local/nagios --with-command-group=nagcmd 4. #解压程序包,并进行预编译前的配置(默认用户就是nagios,所以只需指定组) 5. #make all #编译Nagios程序包源码 6. #make install #安装二进制运行程序 7. #make install-init #初始化脚本 8. #make install-config #配置文件样本 9. #make install-commandmode #设置运行目录权限 10. #make install-webconf #安装Nagios的WEB配置文件到Apache的conf.d目录下

#htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

#创建一个nagiosadmin的用户用于登录Nagios的web界面。

#service httpd restart #重启apache使服务生效

1. #tar zxf nagios-plugins-1.4.15.tar.gz 2. #cd nagios-plugins-1.4.15 3. #./configure --prefix=/usr/local/nagios --with-nagios-user=nagios --with-nagios-group=nagios 4. #make && make install 5. #编译安装nagios插件 #chkconfig --add nagios #chkconfig nagios on #chkconfig httpd on #添加系统服务并设开机自启

#/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg #验证配置文件是否正确,如下图则没问题:

#service nagios start #启动服务

#vim /root/.bashrc #添加一条:alias check='/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg' #source /root/.bashrc #在以后的配置和调试过程中,经常需要检查配置文件,所以加条别名为了方便 #备注:注意防火墙和Selinux(都关了即可)

输入IP/nagios,输入前面设置的用户名密码后,如下图即安装成功。

三、安装后问题及解决办法 问题1:打开ip/nagios,输入口令验证后出现“You don't have permission to access /nagios/ on this server”

解决方法:没装php导致,yum -y install php,装好,重启httpd和nagios 问题2:如果提示“Whoops! Error: Could not read object configuration data! ”,这是因为没有启动nagios后台进程,执行以下命令

解决方法:/usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg

问题3:Nagios显示类似错误:HTTP WARNING: HTTP/1.1 403 Forbidden - 5240 bytes in 0.002 second response time。该错误表明在apache web根目录没有index.html文件。

解决方法:在web根目录(如:/var//html/目录)建立index.html文件,重启apache和nagios即可。

问题4:安装nagios-plugins,make时出现如下报错: make[2]: *** [check_http.o] Error 1 make[2]: Leaving directory `/mnt/nagios-plugins-1.4.13/plugins' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/mnt/nagios-plugins-1.4.13' make: *** [all] Error 2 解决办法:yum -y install openssl openssl-devel,然后重新执行./configure,再编译安装。

Nagios学习笔记之(二)监控部署 2012-08-02 00:01:38 标签:linux 监控 nagios cacti 原创作品,允许,时请务必以超形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。xtony.blog.51cto./3964396/950826

Nagios学习笔记之(二)监控部署

前言:本篇致力于初涉Nagios的同学,老鸟绕行! 前面已经把最基本的Nagios以及插件安装好了,现在只能对本机进行监控,要想监控远程主机,就必须通过类似于NRPE的软件来实现。 监控端和被监控端都要装nrpe,因为靠此来通信,nrpe是通过ssl来通信的,所以比较安全。 用到ssl就得装相关支持的包:yum -y install openssl openssl-devel 现在开始来安装nrpe:

以下操作在监控端进行: 首先把下载下来的nrpe-2.12.tar解压(自行网上下载) 1. #tar zxf nrpe.2.12.tar 2. #cd nrpe-2.12 3. #./configure 4. #make all 5. #make install-plugin

安装完成后会在/usr/local/nagios/libexec/下生成check_nrpe文件

下面定义一个check_nrpe监控命令(默认装好以后没有被nagios调用) 顺带说下监控整体思想: 1.要定义监控的主机或服务 2.执行什么命令来监控 3.出现问题要通知的人 4.采用什么方式通知,|短信 -----后续再细说 修改/usr/local/nagios/etc/commands.cfg(定义命令的文件),添加如下容: 1. define command { 2. command_name check_nrpe 3. command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ 4. }

至此监控端暂时完事。

command_line $USER1$/check_nrpe -H $HOSTADDRE SS$ -t 30 -c $ARG1$ $ARG2$

以下操作在被监控端进行: 需要两个文件: nagios-plugins-1.4.15.tar (nrpe依赖于这个插件) nrpe-2.12.tar (远程通信)

首先创建安装用户:

相关文档
最新文档