nagios安装文档

合集下载

nagios的安装

nagios的安装

在/etc/rc.d/rc.local里面加入下面一行就实现开机启动nrpe了/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d同理要开机运行nagios就在/etc/rc.d/rc.local里面增加下面这行/usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg./check_nrpe -H 10.0.9.154./check_nrpe -H 10.0.9.154 -c check_load./check_nrpe -H 61.153.55.237 -p 5107 -c check_disk -a "-w 15%"/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfgnagios的实现方式:nagios采用分布-集中的管理模式。

在nagios服务器上安装nagios主程序,在被监控主机上安装nagios代理程序。

通过nagios主程序和nagios代理程序之间的通讯,监视主机状态。

主程序和代理程序之间有两种工作方式,一种是主程序-->Active-->代理程序;另一种是主程序-->passive-->代理程序;顾名思义,是以一方向另一方主动提出通讯需求来划分的。

nagios的安装:nagios服务器上需要安装以下包,nagios主程序,nagios的plugin程序,check_nrpe程序,imagepak包;安装笔记1.下载并安装相关软件1)下载相关软件apache #/GD库(1.63以上)#/gd/http/gd-2.0.11.tar.gzzlib #/zlib/zlib-1.1.4.tar.gzpnglib #/libpng/libpng-1.2.5.tar.gzjpeglib #/files/jpegsrc.v6b.tar.gzbasic icons #/nagios/imagepak-base.tar.gz gd,zlib,pnglib,jpeglib这些正常安装即可, ./configure && make && make installnagios #/download/nagios-plugins #/download/nrpe #/download/2、nagios安装#useradd nagios#mkdir /usr/local/nagios#chown -R nagios:nagios /usr/local/nagios#chmod 755 /usr/local/nagios#tar -zxf nagios-3.0.5.tar.gz#cd nagios-3.0.5#./configure --prefix=/usr/local/nagios#make all#make install#make install-init ##This installs the init script in /usr/local/etc/rc.d#make install-commandmode#make install-config ##将初始的配置文件安装到/usr/local/nagios/etc注:在makeinstall-init这一步的时候可能会进行不下去,这时只要加个root组即可。

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 的用户

agios安装文档

agios安装文档

Nagios安装与配置安装环境:centos-5.5Nagios是一款用于系统和网络监控的应用程序。

它可以在你设定的条件下对主机和服务进行监控,在状态变差和变好的时候给出告警信息。

一、安装apache,php前提:#yum –y install *gcc*1、安装freetype(FreeType库是一个开源的、高质量的且可移植的字体引擎)# tar -zxvf freetype-2.4.3.tar.gz -C /usr/src/# cd /usr/src/freetype-2.4.3/# ./configure --prefix=/usr/local/freetype-2.4.3# make# make install2、安装libpng(支持对PNG 图形文件的创建、读写等操作)# tar -zxvf libpng-1.4.4.tar.gz -C /usr/src/# cd /usr/src/libpng-1.4.4/# ./configure --prefix=/usr/local/libpng-1.4.4# make# make install3、安装jpeg(显示JPEG图像)# tar -zxvf jpegsrc.v8b.tar.gz -C /usr/src/# cd /usr/src/jpeg-8b/# ./configure --prefix=/usr/local/jpeg-8b# make# make install4、安装GD库重新加载lib # ldconfig# ldconfig -p | grep jpeg# ldconfig -p | grep free# ldconfig -p | grep libpng# tar -zxvf gd-2.0.33.tar.gz -C /usr/src/# cd /usr/src/gd-2.0.33/# ./configure --prefix=/usr/local/gd-2.0.33 --with-jpeg=/usr/local/jpeg-8b/ --with-freetype=/usr/local/freetype-2.4.3/ --with-png=/usr/local/libpng-1.4.4/ --with-zlib --enable-m4_pattern_allow解决方法:# vim gd_png.c找到png.h 改为/usr/local/libpng-1.4.4/include/png.h# make# make install5、安装apache# rpm -e httpd -–nodeps 把rpm安装的httpd包卸载# tar -zxvf httpd-2.2.15.tar.gz -C /usr/src/# cd /usr/src/httpd-2.2.15/# ./configure --prefix=/usr/local/apache-2.2.15 --enable-so --enable-rewrite# make# make install6、安装php# tar -zxvf php-5.2.10.tar.gz -C /usr/src/# cd /usr/src/php-5.2.10/# ./configure --prefix=/usr/local/php-5.2.10 --with-apxs2=/usr/local/apache-2.2.15/bin/apxs --with-zlib --with-libxml-dir --enable-gd-native-ttf --enable-mbstring --with-gd=/usr/local/gd-2.0.33/ --with-freetype-dir=/usr/local/freetype-2.4.3/ --with-jpeg-dir=/usr/local/jpeg-8b/ --with-png-dir=/usr/local/libpng-1.4.4/解决方法:放入系统光盘yum –y install libxml2* libxml2是一个xml C语言的解析器和工具# make# make test# make installApaceh与php整合# vim /usr/local/apache/conf/httpd.conf53 LoadModule php5_module modules/libphp5.so54 AddType application/x-httpd-php .php167 <IfModule dir_module>168 DirectoryIndex index.php index.html 169 </IfModule>解决方法:# make clean# /usr/src/php- php-5.2.10#make install解决方法:重新make之前要make clean# /usr/local/apache/bin/apachectl start验证:http://localhost二、安装nagios1、创建系统用户# useradd nagios# passwd nagios# groupadd nagcmd# usermod -G nagcmd nagios# usermod -G nagcmd apache3、安装nagios# tar -zxvf nagios-3.1.2.tar.gz -C /usr/src/# cd /usr/src/nagios-3.1.2/# ./configure --with-command-group=nagcmd# make all# make install# make install-init# make install-config# make install-commandmode修改配置文件:# vim /usr/local/nagios/etc/objects/contacts.cfg35 email ********************更改email接收报警内容# make install-webconf 安装nagios的web配置文件到apache的conf.d目录下解决方法以:# mkidr –p /etc/httpd/conf.d# vim /usr/local/apache/conf/httpd.conf: -r /etc/httpd/conf.d/nagios.conf 将文件导入到apache配置文件中# /usr/local/apache/bin/apachectl start 启动apache# /usr/local/apache/bin/htpasswd -c /usr/local/nagios/etc/ers test 创建登录nagios用户3、安装插件1)、nagios-plugis# tar -zxvf nagios-plugins-1.4.14.tar.gz -C /usr/src/# cd /usr/src/nagios-plugins-1.4.14/# ./configure --with-nagios-user=nagios --with-nagios-group=nagios# make# make install到此,nagios已经安装完成,需要做以下设置,启动Nagios# chkconfig –add nagios 将nagios添加到服务中# chkconfig nagios on 设置服务开机启动# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg 检查nagios配置是否正确# service nagios start 启动nagios# setenforce 0 关闭selinux验证:http://localhost/nagios解决方法:# vim /usr/local/nagios/etc/cgi.cfg78 use_authentication=0# service nagios restart(修改nagios侧边栏/usr/local/nagios/share/side.php)三、nagios监控linux服务器服务器:centos 5.5 172.24.0.1 nagios nagios-plugis nrpe客户端:centos 5.5 172.24.0.2 nagios-plugins nrpe因为监控都是依靠插件去完成的,而监控linux主要使用nrpe插件服务器端1、安装nrpe# tar -zxvf nagios-nrpe_2.8.1.orig.tar.gz -C /usr/src/# rpm -qa | grep sslopenssl-0.9.8e-12.el5_4.6# cd /usr/src/nrpe-2.8.1/# ./configure --enable-ssl --with-ssl-lib=/lib/解决方法:# yum -y install openssl-devel# make all# make install-plugin# vim /usr/local/nagios/etc/objects/commands.cfg# 添加#check nrpedefine command{command_name check_nrpecommand_line $US ER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$}# vim /usr/local/nagios/etc/nagios.cfg 配置要监控的linux主机添加:37 cfg_file=/usr/local/nagios/etc/objects/mylinux.cfg# vim /usr/local/nagios/etc/objects/mylinux.cfg 新建监控内容define host{use linux-serverhost_name mylinuxalias mylinuxaddress 192.168.0.21(客户端IP既被监控的IP)}define service{use generic-servicehost_name mylinuxservice_description check-swapcheck_command check_nrpe!check_swap}define service{use generic-servicehost_name mylinuxservice_description check-loadcheck_command check_nrpe!check_load}define service{use generic-servicehost_name mylinuxservice_description check-diskcheck_command check_nrpe!check_had1}define service{use generic-servicehost_name mylinuxservice_description check-userscheck_command check_nrpe!check_users}define service{use generic-servicehost_name mylinuxservice_description otal_procscheck_command check_nrpe!check_total_procs}# service nagios restart客户端配置# useradd nagios# passwd nagios1、安装nagios-plugins# tar -zxvf nagios-plugins-1.4.14.tar.gz -C /usr/src/# cd /usr/src/nagios-plugins-1.4.14/# ./configure --with-nagios-user=nagios --with-nagios-group=nagios # make# make install# chown -R nagios.nagios /usr/local/nagios/# cd /usr/local/nagios/2、安装nagios-nrpe# tar -zxvf nagios-nrpe_2.8.1.orig.tar.gz -C /usr/src/# cd /usr/src/nrpe-2.8.1/# ./configure --enable-ssl --with-ssl-lib=/usr/lib# make all# make install-plugin# make install-daemon# make install-daemon-config# vim /usr/local/nagios/etc/nrpe.cfg72 allowed_hosts=172.24.0.1# /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg –d 启动nrpe # netstat -tulnp | grep 5666 验证nrpe服务器测试# /usr/local/nagios/libexec/check_nrpe -H 172.24.0.2NRPE v2.8.1客户端配置监控对象# vim /usr/local/nagios/etc/nrpe.cfg这一步是关键,如果nagios服务器想要监控客户机swap分区,但客户机nrpe.cfg文件没有swap监控对像,这时监控服务器就是报错(NRPE command ‘check_swap’no defined)至此,查看nagios监控。

nagios中文版安装详解

nagios中文版安装详解
3 authorized_for_configuration_information=nagiosadmin,jvmonitor
4 authorized_for_system_commands=nagiosadmin,jvmonitor
5 authorized_for_all_services=nagiosadmin,jvmonitor
1.关闭selinux,iptables
1 setenforce 0
2 service iptables stop
3 chkconfig iptables off
2.安装httpd php mysql 等基础环境软件
1 yum install httpd* php* mysql* gcc gd* glibc glibc-common (还有一堆软件,如果安装有报错,一般是软件包没装完全)
17 group = nagios
18 server = /var/www/nagios/bin/nrpe
19 server_args = -c /var/www/nagios/etc/nrpe.cfg --inetd
20 log_on_failure += USERID
21 disable = no
2 OK - load average: 0.00, 0.07, 0.07|load1=0.000;15.000;30.000;0; load5=0.070;10.000;25.000;0; load15=0.070;5.000;20.000;0;
3 重启nagios服务
4 service nagios start
05 make all
06 make install

Nagios监控系统安装及配置文档

Nagios监控系统安装及配置文档

Nagios监控系统安装及配置文档1.版本历史2.格式规范本文用红色字体表示注释,绿色字体为操作命令,如:# vi•/var/qmail/control/badmailfrom这个控制文件是实现拒收邮件功能的,每一个地址要单独一行。

而且,不用重起qmail就能生效。

例如:peng@•• • ----限制一个特定的用户,@••••••••• ----限制整个域中的邮件3.参考文档[1] [2] /4.前言做为系统管理员,管理着几十台或几百台服务器在运行。

一个非常迫切的需求就是希望了解服务器及服务器上运行的服务的运行状况,在服务器或服务出现当机或停止的时候能够第一时间知道,及时处理。

以便最小的减少由此带来的影响和损失。

Nagios就是用来解决这个问题的,在目前的一些监控软件中,Nagios 以其良好的稳定性,强大的功能等,已成为业界监控软件的首选。

Nagios官方网站的描述:Nagios is an open source host, service and network monitoring program. Who uses it? Lots of people, including many big companies and organizations:Nagios是一个用来监控主机、服务和网络的开放源码软件,很多大的公司或组织都在使用它。

5.Nagios监控原理上图为Nagios监控原理图。

Nagios监控可以使用主动模式(Action)和被动模式(Passive)。

主动模式主要是自身插件或结合Nrpe实现,由Nagios在定义的时间去主动监测被监控端的服务器或服务是否正常。

被动模式结合Naca实现,由Nsca定时监控服务器或服务,再由Nasa把结果传至Nagios。

被动模式适合大规模服务器(一般在最少100台以上)需要监控的情况,可有效减少监控服务器的压力。

在服务器数量比较少的情况下用主动模式比较方便,因为主要的配置在监控主机的设置就好了,无需在被监控端做过多设置。

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 Network Analyzer 安装手册说明书

Nagios Network Analyzer 安装手册说明书

This document is intended to outline the steps required to manually install Nagios NetworkAnalyzer, along with its prerequisites and sub-components.Target AudienceThis document is written for administrators who are looking to perform a new installation of Nagios Network Analyzer from source, rather than using a pre-configured virtual machine image.Platform SupportNagios Enterprises provide support for installing Nagios Network Analyzer on the following Linux Distributions (Only 64-bit supported):•Red Hat Enterprise Linux (RHEL)◦7.x / 8.x◦RHEL requires the Optional software channel to be enabled, further details are located here:◦Enabling RHEL Optional Software Channel•CentOS◦7.x / 8.x•CentOS Stream•Debian◦9.x / 10.x•Ubuntu◦All active Long Term Support (LTS), these are all the even numbered versions (16, 18, 20)If you discover bugs or have fixes for installing Nagios Network Analyzer on other platforms, please let us know. We will do our best to incorporate your improvements to expand support for additional platforms in future releases, which will make future installation processes smoother for you and your clients.1295 Bandana Blvd N, St. Paul, MN 55108 US: 1-888-624-4671 INTL: 1-651-204-9102Installation PrerequisitesImportant: Nagios Enterprises highly recommends and will only support installing Nagios Network Analyzer on a newly installed, "clean" system (a bare minimal install with nothing else installed or configured).Attempting to install Nagios Network Analyzer on a pre-existing system with other applications already installed can cause the Nagios Network Analyzer installation process to fail, critical system components and settings (e.g. database servers) to be modified in a way that negatively affects other applications, and previously installed applications to be automatically upgraded or removed. While installing Network Analyzer on a system with other applications is possible, it is not recommended due to the possible interactions and complexity of multiple components that are required for Nagios Network Analyzer to function. If you choose to ignore these warnings, you do so at your own risk.Internet access is required for installation and upgrades!Terminal AccessThese instructions require you to establish a terminal session to the server you plan to install Nagios Network Analyzer on. You will need to login to your server as the root user to perform the installation.Install Nagios Network AnalyzerThere are two methods for installing Nagios Network Analyzer, they both perform a full installation, quick and manual.1295 Bandana Blvd N, St. Paul, MN 55108 **************** US: 1-888-624-4671 INTL: 1-651-204-9102QuickExecute the following command in your terminal session:curl https:///downloads/nagios-network-analyzer/install.sh | shThat one command will download and install Nagios Network Analyzer. Please proceed to the Finalize Installation section.Manual DownloadAlternatively, you can install Nagios Network Analyzer by issuing the following commands in your terminal session:cd /tmpwget https:///downloads/nagios-network-analyzer/nagiosna-latest.tar.gz tar xzf nagiosna-latest.tar.gzcd nagiosna./fullinstallNote: If you need to install a specific version of Nagios Network Analyzer, please visit the following page of Nagios Network Analyzer versions to obtain the URL, use that in the wget command above:https:///downloads/nagios-network-analyzer/versions.phpPlease proceed to the Finalize Installation section.1295 Bandana Blvd N, St. Paul, MN 55108 **************** US: 1-888-624-4671 INTL: 1-651-204-9102Finalize InstallationThe installation will be complete when you see this message:Nagios Network Analyzer Installation Success!You can finish the final setup steps for Nagios Network Analyzer by visiting: http://<server_ip_address>/nagiosna/Navigate to the user interface by using the URL provided in your terminal session.When you open the URL provided on the consolein your web browser, you will be shown theInstallation page.Here you will set your Administrator accountUsername, Password and email address. You alsoare able to add your license key if you alreadypurchased your license.Click Finish Installation to save these settings.1295 Bandana Blvd N, St. Paul, MN 55108 **************** US: 1-888-624-4671 INTL: 1-651-204-9102The Log In screen screen will be shown, it will have thestatus of Installation Complete. Type the username andpassword required to login to Nagios Network Analyzer.Click the Log In button to begin.You will be logged into Nagios Network Analyzerand be placed at the home screen.Setting Up SSL/TLSIf you desire to implement SSL/TLS on your Nagios Network Analyzer Server, see Configuring SSL with NNA.1295 Bandana Blvd N, St. Paul, MN 55108 **************** US: 1-888-624-4671 INTL: 1-651-204-9102Finishing UpThis completes the documentation on how to manually install Nagios Network Analyzer.Please refer to the Nagios Network Analyzer Administrator Guide to help you start using Nagios Network Analyzer.Schedule a Quickstart:https:///services/quickstart/nagios-network-analyzer/Contact Sales:****************Nagios Support Forums:https:///forumThe Nagios Support Knowledgebase:https:///kb1295 Bandana Blvd N, St. Paul, MN 55108 **************** US: 1-888-624-4671 INTL: 1-651-204-9102。

ubuntu nagios安装与配置文档

ubuntu nagios安装与配置文档

本系列文章旨在记录作者搭建nagios监控的安装及配置步骤,都经过测试,欢迎指正。

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

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

本篇文章将详细说明如何在ubuntu12.04 server 上安装nagios,并监控本机基本信息。

一、准备1.更新ubuntu系统配置好合适的源后/etc/apt/sources.listsudo apt-get updatesudo apt-get upgrade2.依赖软件包:sudo apt-get install build-essentialsudo apt-get install libssl0.9.8 libssl-devopensslsudo apt-get install libgd2-noxpm libgd2-noxpm-devsudo apt-get install apache2(安装完nagios plugin后可以检查一下http,检查:/usr/local/nagios/libexec/check_http -H 127.0.0.1错误结果:Connection refusedHTTP CRITICAL - Unable to open TCP socket启动apache: service apache2 start后再检查,正确结果:HTTP OK: HTTP/1.1 200 OK - 452 bytes in 0.001 second response time|time=0.001221s;;;0.000000 size=452B;;;0 )安装到目录:/usr/bin/htpasswd/usr/sbin/apache2 link/etc/apache2 配置文件httpd.conf在此/usr/lib/apache2 modules 在此/usr/share/apache2/usr/share/man/man8/apache2.8.gzapt-get install php5安装到目录/usr/bin/php5 /etc/php5 /usr/lib/php5 /usr/share/php5/usr/share/man/man1/php5.1.gz二、下面进行nagios的安装以下操作要在root权限用户下进行修改root密码:sudopasswd root设置root密码su切到root用户1.下载nagios软件包下载所需安装包,在/usr/local/src目录下载wget /sourceforge/nagios/nagios-3.2.3.tar.gzwget /sourceforge/nagiosplug/nagios-plugins-1.4.15.tar.gz wget /sourceforge/nagios/nrpe-2.12.tar.gz2.创建所需用户和组信息groupaddnagcmdgroupaddnagiosuseradd -gnagiosnagios3.安装nagiostar zxvf nagios-3.2.3.tar.gzcd nagios-3.2.3./configure --prefix=/usr/local/nagios --with-command-group=nagcmd终端打印出configure信息:注意关于apache2和mail的配置,以后可能会修改,记住位置:Apache conf.d directory: /etc/apache2/conf.dMail program: /usr/bin/mail编译:make all根据上述提示安装:make installmake install-initmake install-configmake install-commandmodemake install-webconf其中要注意每一步的安装信息,主要是安装目录,方便以后修改。

Nagios快速安装中文版

Nagios快速安装中文版

Nagios快速安装中文版需要工具:VMware Workstation、SSH Secure Shell Client、CentOS5.3首先安装好CentOS5.3,建议使用命令行界面安装。

安装完后用SSH Secure Shell Client连接服务器可直接复制粘帖安装配置Nagios安装需要root权限,先确保已经安装以下软件包ApacheGCC compilerGD development libraries如果没有安装,可以用yum来自动安装这些软件包,需要连接网络或者配置好yum的安装源比如CDROMyum install httpdyum install gccyum installglibcglibc-commonyum installgdgd-devel1) 创建nagios帐号信息并且设置好密码su -l/usr/sbin/useradd -m nagiospasswdnagios会要求输入密码创建nagcmd 组,并把nagios和apache加入到该组中/usr/sbin/groupaddnagcmd/usr/sbin/usermod -a -G nagcmdnagios/usr/sbin/usermod -a -G nagcmd apache2) 下载nagios和nagios的插件(根据最新版本,安装包名会有所变动)mkdir ~/downloadscd ~/downloadswget /download/nagios-3.0.6.tar.gzwget /download/nagios-plugins-1.4.13.tar.gz3) 编译和安装nagioscd ~/downloadstar xzf nagios-3.0.6.tar.gzcd nagios-3.0.6运行nagios的配置脚本,开始配置nagios./configure --with-command-group=nagcmd编译nagios源码包,make命令需要调用当前目录下的Makefile的文件,执行make时不能离开现在这个目录make all安装二进制文件,初始化脚本,sample的配置文件,并且设置目录权限make installmake install-initmake install-configmake install-commandmode4) 个性化的配置(可不设置)在/usr/local/nagis/etc/目录下已经安装了一些配置文件的样本,可以根据需要修改里面的配置。

nagios完全安装使用手册

nagios完全安装使用手册

nagios完全安装手册一、虚拟机安装1、推荐版本号VMware-workstation-full-9.0.22、选择“完全安装”,全部选择默认选项,一路“下一步”,注:安装路径推荐安装在C:\下。

3、安装完成后,使用注册码:JV695-DR0D3-LZUC0-H8852-CAWJ4或4F297-84H0M-MZN18-X207P-ACQLQ4、安装VMware9汉化包。

5、打开VMware-workstation,进入VMware-workstation界面6、点击“创建新的虚拟机”7、在新建虚拟机向导中选择“自定义(高级)”选项》"继续"。

8、选择“我以后安装操作系统”》“继续”9、选择“客户机操作系统”为“linux”,版本号选择“Red Hat Enterprise Linux 5 64-bit”》"继续"。

选择的版本位数与主机的操作系统位数一致,32位或64位。

10、创建虚拟机名称,在“位置”选项中将虚拟系统放置除C:\以外的任意磁盘,注:虚拟系统安置的磁盘尽可能保证没有重要文件的空磁盘。

》“继续”11、处理器配置选择默认》“继续”12、虚拟机内存可选择1G或1G倍数。

》“继续”13、网络类型,选择“使用桥接网络”》“继续”14、选择i/O控制器类型,LSI逻辑》“继续”15、选择“创建一个新的虚拟磁盘”》“继续”16、选择磁盘类型为“SCSI”》“继续”17、指定磁盘容量,在最大磁盘空间输入你刚选择的虚拟系统安装盘实际可用空间大小,例如可用空间为499G,填入499G。

勾选“虚拟磁盘拆分成多个文件”18、准备创建虚拟机就绪,选择“定制硬件”》“新建CD/DVD”》“使用ISO映像文件”》“浏览”》选中本地磁盘中的虚拟系统ISO系统文件》“关闭”》“完成”19、选择“打开虚拟机电源”20、如果弹出下对话框,则需要到BIOS中,在高级\处理器设置\Intel虚拟技术选为“开启”》保存重启电脑21、进入该页面,等待安装22、选择“Skip”》“Next”23、选择“简体中文”》“next”24、选择“美国英语式”》“下一步”25、安装号码处填写序列号》“确认”26、在“警告”中选择“是”27、选择“建立自定义的分区结构”》“下一步”28、点击“新建”》挂载点选择“/”》“文件系统类型”选择“ext3”》“大小”,填写磁盘大小,此处数值物理磁盘数值的90%》勾选指定空间大小》“确定”29、再点击“新建”》挂载点选择“/boot”》“文件系统类型”选择“ext3”》“大小”选择,剩余空间的7%》勾选指定空间大小》“确认”30、再点击“新建”》挂载点不选》“指定文件系统类型”选择"SWAP"》勾选“使用全部可用空间”》“确定”31、点击“下一步”32、选择“下一步”“手工配置”输入虚拟系统主机名》输入网关和DNS》“下一步”34、选择时区35、填写“根密码”》“下一步”36、其他保持默认,选择“现在定制”》“下一步”37、“桌面环境”、“应用程序”、“开发”、“服务器”、“基本系统”右侧的所有分选项全部勾选,“虚拟化”、“语言支持”保持默认》“下一步”38、“下一步”39、系统开始安装,耐心等待40、“重新引导”,等待重新启动41、进入欢迎界面》“前进”42、勾选“是,我同意”》“前进”43、“SELinux设置”选择“禁用”》“前进”》“是”】45、修改时间》“前进”46、勾选“不,我将在以后注册”》“前进”47、选择“不,我将在以后注册”》“前进”48、自己创建用户名、全名、口令、确认口令》“前进”49、“前进”50、“完成‘51、”确定“,到此,linux系统安装、配置完成。

NAGIOS 安装与配置

NAGIOS 安装与配置

NAGIOS 安装与配置1 安装前的准备○1创建nagios用户和用户组#useradd –s /usr/sbin/nologin nagios#mkdir /usr/local/nagios#chown –R nagios.nagios /usr/local/nagios○2开启sendmail系统2编译安装nagios#tar –zxvf nagios-3.2.3.tar.gz#cd nagios-3.2.3#./configure --prefix=/usr/local/nagios指定nagios的安装目录/usr/local/nagios#make all#make installmake all是安装主程序#make install-init通过这个命令可以在/etc/rc.d/init.d创建启动脚本。

#make install-commandmode通过这个命令来配置目录权限。

#make install-config这个命令用来安装nagios示例配置文件,这里安装的路径是/usr/local/nagios/etc 3 安装nagios的插件注意,插件板本与nagios版本关联不大#tar -zxvf nagios-plugins-1.4.15.tar.gz#cd nagios-plugins-1.4.15#./configure --prefix=/usr/local/nagios#make#make install4 安装nagios的中文化插件#tar zxvf nagios-cn-3.2.3#cd nagios-cn-3.2.3#./configure#make all#make install5 安装与配置apache和php○1安装apache○2配置apache php找到User apacheGroup apache改为User nagiosGroup nagios找到DirectoryIndex index.html index.html.var改为DirectoryIndex index.html index.php增加AddType Application/x-httpd-php,php增加下面的seting for nagiosScriptAliax /nagios/cgi-bin "/usr/local/nagios/sbin"<Directory "usr/local/nagios/sbin">AuthType BasicAllowOverride NodeOptions ExecCGIOrder allow,denyAllow from allAuthName "Nagios Access" AuthuserFile /usr/local/nagios/etc/htpasswdRequire valid-user</Directory>Alias /nagios "/usr/local/nagios/share"<Directory "/usr/local/nagios/share">AuthType BasicOptions NoneAllowoverride NoneOrder allow,denyAllow from allAuthName "nagios Access" AuthUserFile /usr/local/nagios/etc/htpasswdRequire valid-user</Directory>○3创建nagios目录验证文件#htpasswd –c /usr/local/nagios/etc/htpasswd ixdba。

Nagios安装

Nagios安装

一.nagios在服务器端(监控端)的安装。

服务器IP地址:192.168.0.131.在安装之前首先检测系统是否安装以下包:httpd php gcc glibc glibc-common gd gd-devel#rpm -qa | grep httpd#rpm -qa | grep php....#rpm -qa | grep gd2.创建用户#useradd nagios#groupadd nagcmd#/usr/sbin/usermod -a -G nagcmd nagios#/usr/sbin/usermod -a -G nagcmd apache3.安装nagios包(此处用3.2.0版本)#tar zxvf nagios-3.2.0.tar.gz#cd nagios-3.2.0#./configure --prefix=/usr/local/nagios --with-command-group=nagcmd#make#make install#make install-init#make install-config#make install-commandmode#make install-webconf4.创建管理用户并启动apache#htpasswd -c /usr/local/nagios/etc/ers nagiosadminpasswd:******此处所创建用户为nagiosadmin,如果为其他用户刚后面要修改文件:/usr/local/nagios/etc/cgi.cfg,后面再讲。

#service httpd restart5.安装nagios-plugins(此处用1.4.13版本)#tar zxvf nagios-plugins-1.4.13.tar.gz#cd nagios-plugins-1.4.13#./configure --with-nagios-user=nagios --with-nagios-group=nagios--prefix=/usr/local/nagios#make#make install6.注册服务,设置开机启动#chkconfig --add nagios#chkconfig nagios on7.此时完成初步安装,可以监控查看本机的一些服务,检测配置文件并启动nagios#/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfgChecking for circular paths between hosts...Checking for circular host and service dependencies...Checking global event handlers...Checking obsessive compulsive processor commands...Checking misc settings...Total Warnings: 0Total Errors: 0出现此处,表明,配置文件没有错误,可以启动nagios#service nagios start8.登录查看http://192.168.0.13/nagios/输入创建的用户名nagiosadmin与设置密码,进去可操作。

nagios监控安装部署文档

nagios监控安装部署文档

首先搭载LAMP环境一.所需要的安装包:Redhat系统需要有gcc, gcc-c++编译器libxml2-2.6.30libmcrypt-2.5.8zlib-1.2.3libpng-1.2.31jpeg6freetype-2.3.5autoconf-2.61gd-2.0.35httpd-2.2.9ncurses-5.6php-5.2.6mysql-5.0.41二.安装步骤cd /lamp/libxml2-2.6.30./configure --prefix=/usr/local/libxml2/ makemake installcd /lamp/libmcrypt-2.5.8./configure --prefix=/usr/local/libmcrypt/ makemake installcd /lamp/libmcrypt-2.5.8/libltdl./configure --enable-ltdl-installmakemake installcd /lamp/zlib-1.2.3./configuremakemake installcd /lamp/libpng-1.2.31./configure --prefix=/usr/local/libpng/ makemake installmkdir /usr/local/jpeg6mkdir /usr/local/jpeg6/binmkdir /usr/local/jpeg6/libmkdir /usr/local/jpeg6/includemkdir -p /usr/local/jpeg6/man/man1cd /lamp/jpeg-6b./configure --prefix=/usr/local/jpeg6/ --enable-shared --enable-staticmakemake installcd /lamp/freetype-2.3.5./configure --prefix=/usr/local/freetype/makemake installcd /lamp/autoconf-2.61./configuremakemake installcd /lamp/gd-2.0.35./configure --prefix=/usr/local/gd2/ --with-jpeg=/usr/local/jpeg6/--with-freetype=/usr/local/freetype/makemake installcd /lamp/httpd-2.2.9./configure --prefix=/usr/local/apache2/ --sysconfdir=/etc/httpd/ --with-included-apr --disable-userdir --enable-so --enable-deflate=shared --enable-expires=shared --enable-rewrite=shared --enable-static-supportmakemake install/usr/local/apache2/bin/apachectl startecho "/usr/local/apache2/bin/apachectl start" >> /etc/rc.d/rc.sysinitcd /lamp/ncurses-5.6./configure --with-shared --without-debug --without-ada --enable-overwritemakemake installgroupadd mysqluseradd -g mysql mysqlcd /lamp/mysql-5.0.41./configure --prefix=/usr/local/mysql/ --with-extra-charsets=all makemake installcp support-files/f /etc/f/usr/local/mysql/bin/mysql_install_db --user=mysqlchown -R root /usr/local/mysqlchown -R mysql /usr/local/mysql/varchgrp -R mysql /usr/local/mysql/usr/local/mysql/bin/mysqld_safe --user=mysql &cp /lamp/mysql-5.0.41/support-files/mysql.server /etc/rc.d/init.d/mysqldchown root.root /etc/rc.d/init.d/mysqldchmod 755 /etc/rc.d/init.d/mysqldchkconfig --add mysqldchkconfig --list mysqldchkconfig --levels 245 mysqld offcd /lamp/php-5.2.6./configure --prefix=/usr/local/php/ --with-config-file-path=/usr/local/php/etc/--with-apxs2=/usr/local/apache2/bin/apxs--with-mysql=/usr/local/mysql/--with-libxml-dir=/usr/local/libxml2/--with-jpeg-dir=/usr/local/jpeg6/--with-freetype-dir=/usr/local/freetype/--with-gd=/usr/local/gd2/ --with-mcrypt=/usr/local/libmcrypt/ --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-soap --enable-mbstring=all --enable-socketsmakemake installcp php.ini-dist /usr/local/php/etc/php.iniecho "Addtype application/x-httpd-php .php .phtml" >> /etc/httpd/httpd.conf/usr/local/apache2/bin/apachectl restart#rpm –ivh libtool-1.5.22-7.el5_4.i386.rpm#rpm –ivh libtool-ltdl-1.5.22-7.el5_4.i386.rpm#rpm –ivh libtool-ltdl-devel-1.5.22-7.el5_4.i386.rpm PHP支持JSON扩展#tar jxvf php-json-ext-1.2.1.tar.bz2#cd php-json-ext-1.2.1#phpize-bash: phpize: command not found#rpm -ivh php-devel-5.1.6-23.2.el5_3.i386.rpm#phpize#./configure#make && make install# find / -name *json.so/usr/lib/php/modules/json.so/root/soft/php-json-ext-1.2.1/modules/json.so/root/soft/php-json-ext-1.2.1/.libs/json.so#vi /etc/php.d/json.ini添加以下内容extension=json.so保存退出# service httpd restart测试PHP是否支持json扩展#vi /var/www/html/test.php<?phpphpinfo();phpinfo(INFO_GENERAL);phpinfo(1);?>监控机上安装Nagios一.所需要的安装包nagios-3.2.3.tar.gznagios-plugins-1.4.15.tar.gznrpe-2.12.tar.gzndoutils-1.4b7.tar.gzDBI-1.607.tar.gzDBD-mysql-3.0008.tar.gz(一)监控机的操作:1.安装前的依赖检查[root@localhost ~]# rpm -q httpd php gcc glibc glibc-commongd gd-devel2.创建Nagios 账户和组[root@localhost src]# useradd -m nagios[root@localhost src]# groupadd nagcmd[root@localhost src]# usermod -a -G nagcmd nagios[root@localhost src]# usermod -a -G nagcmd apache3.编译安装[root@localhost src]# tar xvf nagios-3.2.0.tar.gz[root@localhost src]# cd nagios-3.2.0[root@localhost nagios-3.2.0]# less Makefile[root@localhost nagios-3.2.0]# ./configure --with-command-group=nagcmd --with-nagios-user=nagios --with-nagios-group=nagios[root@localhost nagios-3.2.0]# make all[root@localhost nagios-3.2.0]# make install[root@localhost nagios-3.2.0]# make install-init (生成init 启动脚本)[root@localhost nagios-3.2.0]# make install-config (生成一些模板配置文件)[root@localhost nagios-3.2.0]# make install-commandmode (设置相应的权限)[root@localhost nagios-3.2.0]# make install-webconf (生成Apache 配置文件nagios.conf)4.为Nagios 设置Web 验证的密码。

Nagio安装手册

Nagio安装手册

Nagios 安装和配置手册目录Nagios 安装和配置手册 (1)一、安装介质 (3)二、其他环境要求 (4)✓Gcc编译器 (4)✓Apache (4)✓php5 安装 (4)✓libACE程序php5 (安装飞信适用) (4)✓freetype2-devel (4)✓fontconfig-devel (4)✓freetype2-devel (4)✓libjpeg-devel (4)✓jpeg-6b-752.2 (4)✓libpng-devel (4)✓xorg-x11-devel (4)✓gd-devel (4)✓zlib (4)✓openssl-devel (4)✓readline-devel (4)✓libxml2-devel (4)✓rrdtool (4)三、安装mysql数据库 (4)1)网上下载绿色包解压运行mysql (4)2)使用系统光盘安装mysql (6)四、nagios安装(基于openSUSE平台的快速指南) (7)✓建立帐号 (7)✓编译与安装Apache (8)✓编译与安装php5 (8)✓编译与安装Nagios (9)✓简单客户化配置 (10)✓配置WEB接口 (10)✓编译并安装Nagios插件 (10)✓启动Nagios (10)✓登录WEB接口 (13)✓配置EMail报警 (13)✓配置SMS报警 (14)✓其他的变更 (15)五、基本配置文件修改和定义 (16)1)新增http界面登陆和操作用户 (16)2)新增扩展脚本或者程序 (16)六、安装SNMP监控支持 (16)七、安装NRPE (18)八、nagios 的图形工具-pnp (20)1、pnp安装 (21)2、pnp配置(Default Mode) (23)3、pnp配置(Bulk Mode) (24)4、pnp配置(Bulk Mode with NPCD) (25)5、为nagios的服务添加太阳图标 (27)九、监控配置示例与说明 (27)十、FAQ (27)1、如何在nagios中使用外部命令 (33)2、pnp时区问题 (34)3、pnp不支持eregi()函数问题 (34)4、pnp不支持pdf函数问题 (35)5、Nagios Web验证和Nagios验证分开 (35)一、安装介质/downloadStep 1 - Download Nagios CoreRequired. Contains the monitoring application and web interface.Download Nagios Core >Step 2 - Download Nagios PluginsAlso Required. Allows you to monitor services, applications, metrics, and more.Download Nagios Plugins >Step 3 - Download Nagios AddonsTrick out your Nagios install by extending its capabilities with hundreds of community-contributed addons.Download Nagios Addons >Nagios AddonsNRPENRPE allows you to remotely execute Nagios plugins on other Linux/Unix machines. This allows you to monitor remote machine metrics (disk usage, CPU load, etc.). NRPE can also communicate with Windows agent addons like NSClient++, so you can check metrics on remote Windows machines as well.NSCANSCA allows you to integrate passive alerts and checks from remote machines and applications with Nagios. Useful for processing security alerts, as well as deploying redundant and distributed Nagios setups.NDOUtilsNDOUtils allows you to export current and historical data from one or more Nagios instances to a MySQL database. Experimental/beta at this point in time, but several community addons use this as one of their data sources.Step 4 - Get SupportAccess community documentation and world-class technical support to see you through your IT monitoring challenges.Get Support >二、其他环境要求✓Gcc编译器✓Apache✓php5 安装✓libACE程序php5 (安装飞信适用)✓freetype2-devel✓fontconfig-devel✓freetype2-devel✓libjpeg-devel✓jpeg-6b-752.2✓libpng-devel✓xorg-x11-devel✓gd-devel✓zlib✓openssl-devel✓readline-devel✓libxml2-devel✓rrdtool✓mysql三、安装mysql数据库1)网上下载绿色包解压运行mysql添加账户和组groupadd mysqluseradd -g mysql mysqltar xvfz mysql-5.1.26-rc-linux-i686-glibc23.tar.gzln -s /usr/local/mysql-5.1.26-rc-linux-i686-glibc23 mysqlchown -R mysql:mysql /usr/local/mysql-5.1.26-rc-linux-i686-glibc23chown -R mysql:mysql mysqlcd /usr/local/mysqlscripts/mysql_install_db -user=mysqlbin/mysqld_safe -user=mysql &/usr/local/mysql/bin/mysqladmin -uroot password nagiosadmincp /usr/local/mysql/support-files/mysql.server /etc/init.d/rc5.d/S99mysql更改MySQL目录MySQL默认的数据文件存储目录为/var/lib/mysql。

nagios配置文档

nagios配置文档

Nagios是一款优秀的监控软件,它主要通过插件的形式来实现对主机和服务的监控,它最重要的特点是能够实现多种途径的报警,例如:邮件,短信,飞信等等,现将其配置过程介绍如下:搭建环境:Nagios-server:Centos4.8,2.6.9-89.Elsmp,IP:192.168.9.130Linux-client:Centos4.8,2.6.-89.Elsmp,IP:192.168.9.73软件版本:Nagios-3.2.1.tar,nagios-plugins-1.4.14.tar,nrpe-2.12.tar工作原理如下图:开始配置,首先是nagios-server端:安装必要的软件包和添加用户:Nagios安装:为nagiosweb界面设置访问控制:然后接着测试访问http://192.168.9.130/nagios,会出现nagios的web界面,如下图:安装nagios-plugins在./configure过程中,如果出现checking for redhat spopen problem...停在这里动不了,可加上—enable-redhat-pthread-workaround重新进行编译。

紧接着我在监控本机的配置文件localhost.cfg中又添加了两个服务FTP和NFS接下来安装和定义nrpe然后配置监控linux client的配置文件定义host的:定义hostgroup的:定义服务的:(所有服务均如下图所示修改host_name即可)接着追加测试nagios的配置文件是否有错误:如没错误会出现以下图示:至此,服务端配置结束。

Linux-client配置如下:添加用户安装nagios-plugin在编译时可能会出现no acceptable c compiler found in $PATH这样的错误,这时你需要安装gcc软件包,再重新编译。

安装nrpe在编译时可能会报这样的错:checking for SSL headers…configure:error:Cannot find ssl headers, 需要安装openssl*软件包,安装完后再重新编译。

Nagios监控软件安装和配置文档

Nagios监控软件安装和配置文档

监控软件安装和配置文档监控软件安装和配置文档 (1)1 初始安装 (1)1.1 监控软件介质列表 (1)1.2 服务端安装 (2)1.2.1 软件包安装 (2)1.2.2 创建系统业务用户 (2)1.2.3 上传安装包 (3)1.2.4 编译安装Nagios (3)1.2.5 配置web接口 (3)1.2.6 编译和安装Nagios plugins (4)1.2.7 安装Nagios Chinese plugin (4)1.2.8 开启nagios (4)1.2.9 登陆web界面 (4)1.3 Linux客户端安装 (5)1.3.1 创建系统业务账户 (5)1.3.2 上传安装包 (5)1.3.3 安装Nagios Plugins (5)1.3.4 安装xinetd (5)1.3.5 安装NRPE daemon (6)1.3.6 测试本地NRPE daemon (6)1.3.7 配置NRPE命令 (7)1.3.8 服务端配置(新添节点忽略) (7)1.3.9 定制监控服务(新添节点忽略) (11)1.4 Windows客户端安装 (12)1.4.1 what’s Already Done For you (12)1.4.2 Prerequisites (13)1.4.3 Installing the Windows Agent (13)1.4.4 Monitoring Machine (服务端配置新添加节点则滤过) (18)2 事件处理 (22)2.1 Linux事件处理 (22)2.2 日志 (25)2.3 测试方法 (25)1初始安装1.1监控软件介质列表1.2服务端安装1.2.1软件包安装安装中一部分需要有root权限。

需要以下安装包:●Apache●PHP●GCC compiler●GD可以利用yum安装1.2.2创建系统业务用户以root用户登录建立一个新的nagios 用户账户并设置密码用于操作nagios建立一个新的 nagcmd 组添加nagios和apache用户到此组。

Nagios安装说明文档

Nagios安装说明文档

Linux下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的功能是监控服务和主机,但是他自身并不包括这部分功能,所有的监控、检测功能都是通过各种插件来完成的。

nagios安装-监控-报警配置详解-byHF

nagios安装-监控-报警配置详解-byHF

Nagios安装与配置详解内容简介本文档介绍nagios监控linux服务器, 因为监控都是依靠插件去完成的,而监控linux主要使用NRPE插件,本文首先简单介绍一下NRPE监控基础,及监控过程,然后一步步的配置一个实例实现监控linux服务器1.NRPE监控插件基础NRPE总共由两部分组成:check_nrpe插件,运行在监控主机上。

NRPE daemon,运行在远程的linux主机上(通常就是被监控机)整个的监控过程:(如下图)当Nagios需要监控某个远程linux主机的服务或者资源情况时:1).nagios运行check_nrpe插件,我们要在nagios配置文件中告诉它要检查什么.2).check_nrpe插件会通过SSL连接到远程的NRPE daemon.3).NRPE daemon会运行相应的nagios插件来执行检查本地资源或服务.4).NRPE daemon将检查的结果返回给check_nrpe插件,插件将其递交给nagios做处理.注意:NRPE daemon需要nagios插件安装在远程被监控linux主机上,否则,daemon不能做任何的监控. 别外因为它们间的通信是加密的SSL,所以在编译安装时都要加上选项, ./configure --enable-ssl --with-ssl-lib=/lib/,否则也会出错.安装Nagios一、准备软件包在做安装之前确认要对该机器拥有root权限。

确认你安装好的linux系统上已经安装如下软件包再继续。

ApacheGCC编译器[root@localhost ~]# rpm -qa | grep gdgd-devel-2.0.33-9.3.fc6gdb-6.5-16.el5gd-2.0.33-9.3.fc6gdbm-1.8.0-26.2.1sysklogd-1.4.1-39.2gdm-2.16.0-30.el5[root@localhost ~]# rpm -qa | grep glibglibc-head ers-2.5-12dbus-glib-0.70-5NetworkManager-glib-0.6.4-6.el5avahi-glib-0.6.16-1.el5glibc-2.5-12glibc-common-2.5-12glib-java-0.2.6-3.fc6compat-glibc-head ers-2.3.4-2.26glib2-2.12.3-2.fc6glibc-devel-2.5-12compat-glibc-2.3.4-2.2[root@localhost nagios]# rpm -qa | grep gcccompat-gcc-34-3.4.6-4gcc-4.1.1-52.el5gcc-c++-4.1.1-52.el5compat-gcc-34-g77-3.4.6-4libgcc-4.1.1-52.el5compat-gcc-34-c++-3.4.6-4gcc-gfortran-4.1.1-52.el5下面安装需要用到的软件包下载地址:1.nagios/project/nagios/nagios-3.x/nagios-3.2.1/nagios-3.2.1.tar.gz2.nagios-plugins-1.4.14.tar.gz/project/nagiosplug/nagiosplug/1.4.14/nagios-plugins-1.4.14.tar.g z3.nrpe-2.12.tar.gz/project/nagios/nrpe-2.x/nrpe-2.12/nrpe-2.12.tar.gz二、安装Nagios操作过程2.2 创建一个用户组名为nagioscmd用于从Web接口执行外部命令。

nagios安装说明书

nagios安装说明书

安装nagios下载的安装包和插件自己放到一个目录下面,装的时候看好在哪个文件夹下。

安装前首先要安装下面的软件包:yum install httpd mysql mysql-server php php-mysql -yyum install gccyum install glibc glibc-commonyum install gd gd-devel下面这个是添加分组,创建一个用户组名为nagcmd用于从Web接口执行外部命令。

将nagios 用户和apache用户都加到这个组中。

cd进入到解压的文件夹下,运行Nagios配置脚本并使用先前开设的用户及用户组:./configure --sysconfdir=/etc/nagios --with-command-group=nagcmd --enable-event-broker然后make编译Nagios程序包源码:安装二进制运行程序、初始化脚本、配置文件样本并设置运行目录权限,Make all :编译所有内容。

配置一个web接口:Make install-webconf: 安装web接口。

安装Nagios的WEB配置文件到Apache的conf.d目录下: htpasswd -c /etc/nagios/ers nagios下面是启动nagios服务:启动前要整下面的配置插件:编译并安装这个插件,./configure --with-nagios-user=nagios --with-nagios-group=nagios 然后make 接着make install。

重新启动nagios:Setenforce 0:令SELinux处于容许模式service nagios restart :重新启动nagiosservice nagios start : 启动nagios服务serviece httpd restart :重启Apache服务以使设置生效,第一步:打开xshell输入下面的东西yum install httpdyum install gccyum install glibc glibc-commonyum install gd gd-devel在root用户下创建一个新账号。

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

nagios安装文档
操作系统:ubuntu server 8.0.4
安装基础环境:apt-get install build-essential libgd2-xpm-dev
添加编辑用户和组
useradd nagios
groupadd nagios
groupadd nagcmd
usermod -G nagcmd nagios
usermod -G nagcmd www-data
安装nagios
wget /sourceforge/nagios/nagios-3.2.1.tar.gz
tar –zxvf nagios-3.2.1.tar.gz
cd nagios-3.2.1
./configure --with-command-group=nagcmd
make all
make install
make install-init
make install-config
make install-commandmode
make install-webconf
增加web认证帐号
htpasswd -c /usr/local/nagios/etc/ers nagiosadmin
连接启动文件
ln -s /etc/init.d/nagios /etc/rcS.d/S99nagios
重启apache
/etc/init.d/apache2 restart
安装nagios plugins
wget /sourceforge/nagiosplug/nagios-plugins-1.4.15.tar.gz
tar –zxvf nagios-plugins-1.4.15.tar.gz
cd nagios-plugins-1.4.15
./configure --prefix=/usr/local/nagios --with-nagios-user=nagios --with-nagios-gourp=nagios make
make install
安装NDoutils
NDoutils是Nagios的mysql mod,可以把Nagios的信息写到mysql中,从而使cacti 的NPC 得到相关的信息。

准备环境:apt-get install libmysql++-dev
wget http://*****/ ndoutils-1.4b9.tar.gz。

tar xzf ndoutils-1.4b9.tar.gz
cd ~/ndoutils/ndoutils-1.4b9
./configure
make
接下来不用make install
cd ~/ndoutils/ndoutils-1.4b9/src
cp ndomod-3x.o ndo2db-3x log2ndo file2sock /usr/local/nagios/bin
cd ~/ndoutils/ndoutils-1.4b9/config
cp ndomod.cfg ndo2db.cfg /usr/local/nagios/etc/
配置ndo2db.cfg
vi /usr/local/nagios/etc/ndo2db.cfg
更改以下内容
db_name = cacti
db_prefix = npc_
db_user = cacti
db_pass = cacti
debug_level = 1
这里是用Cacti在mysql中使用的用户和密码以及数据库
修改Nagios的config文件,使NDoutils可以在Nagios中加载
vi /usr/local/nagios/etc/nagios.cfg
check_external_commands = 1
command_check_interval = -1
event_broker_options = -1
添加
broker_module = /usr/local/nagios/bin/ndomod-3x.o config_file=/usr/local/nagios/etc/ndomod.cfg
然后分别启动NDoutils和Nagios
/usr/local/nagios/bin/ndo2db-3x -C /usr/local/nagios/etc/ndo2db.cfg
/etc/init.d/nagios start
在Web里面配置NPC
在Cacti中,点击左边的Settings,点到NPC的tab,勾上Remote Commands,Nagios Command File Path中输入/usr/local/nagios/var/rw/nagios.cmd,Nagios URL中输入http://192.168.15.41/nagios/,然后Save一下。

安装nrpe
wget /sourceforge/nagios/nrpe-2.12.tar.gz
apt-get install libssl-dev
apt-get install openssl
tar -zxvf nrpe-2.12.tar.gz
cd nrpe-2.12
./configure
make all
make install-plugin
被监控linux服务器安装:
apt-get update 需要10分钟
apt-get install build-essential 需要1小时
apt-get install libssl-dev 需要5分钟
useradd nagios
wget /sourceforge/nagiosplug/nagios-plugins-1.4.15.tar.gz tar -zxvf nagios-plugins-1.4.15.tar.gz
cd nagios-plugins-1.4.15
./configure --prefix=/usr/local/nagios
Make
Make install
chown -R nagios.nagios /usr/local/nagios/
apt-get install openssl
apt-get install libssl-dev
wget /sourceforge/nagios/nrpe-2.12.tar.gz
tar -zxvf nrpe-2.12.tar.gz
cd nrpe-2.12
./configure
make all
make install-daemon
make install-daemon-config
nagios server 监控mysql
/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg –d
tar -zxvf check_mysql_health-2.1.2.tar.gz
./configure --prefix=/usr/local/nagios
make && make install
#./check_mysql_health -H mysqlhost --user nagios --password XXXX --mode threads-connected。

相关文档
最新文档