Nagios 介绍
Nagios 是一款Linux 上成熟的监视系统运行状态和网络信息的开源软件,可以对对主机或服务进行检测的自动化工具;Nagios 能监控所指定的本地或远程主机及服务,同时提供异常通知、事件处理等功能。与商业IT管理系统相比,Nagios 具有成本低廉、结构简单、可维护性强等诸多优点。
Nagios 安装配置:
*安装环境 CentOS 6.3
*新版本改进
3.4.4 - 01/12/2013
------------------
* Reenabled check for newer versions of Nagios Core (Mike Guthrie)
* Fixed bug #408: service checks get duplicated on reload (Eric Stanley)
* Fixed bug #401: segmentation fault on Solaris when parsing unknown timeperiod directives. (Eric Stanley)
* Added NULL pointer checks to CGI code. (Eric Stanley)
* Fixed buffer overflow vulnerability in CGI code. Thanks to Neohapsis (http://archives.neohapsis.com/archives/fulldisclosure/2012-12/0108.html) for finding this. (Eric Stanley)
一、创建用户和组
[root@localhost ~]# useradd -s /sbin/nologin nagios
[root@localhost ~]# mkdir /usr/local/nagios
[root@localhost ~]# chown -R nagios:nagios /usr/local/nagios/
二、安装apache、php、sendmail、gd_devel
[root@localhost ~]# yum install gd-devel httpd httpd-devel php sendmail -y
三、编译安装Nagios
[root@localhost ~]# wget http://sourceforge.net/projects/nagios/files/nagios-3.x/nagios-3.4.4/nagios-3.4.4.tar.gz
[root@localhost ~]# tar zxvf nagios-3.4.4.tar.gz
[root@localhost ~]# cd nagios #跟老版本有点区别
[root@localhost nagios]# ./configure --prefix=/usr/local/nagios/ #指定安装目录
[root@localhost nagios]# make all
[root@localhost nagios]# make install #安装Nagios主程序的CGI和HTML文件
[root@localhost nagios]# make install-init #创建Nagios启动脚本
[root@localhost nagios]# make install-commandmode #配置目录权限
[root@localhost nagios]# make install-config #安装Nagios示例配置文件
* nagios安装完成后,目录对应的功能说明如下:
bin:可执行程序所在目录
etc:配置文件所在目录
sbin:cgi文件所在目录,也就是执行外部命令所需文件所在目录
share:网页文件所在目录
libexec:外部插件所在目录
var:日志文件,lock等文件所在目录
var/archives:日志自动归档目录
var/rw:用来存放外部命令文件的目录
四、编译安装nagios-plugins
[root@localhost ~]# wget http://sourceforge.net/projects/nagiosplug/files/latest/download?source=directory
[root@localhost ~]# tar zxvf nagios-plugins-1.4.16.tar.gz
[root@localhost ~]# cd nagios-plugins-1.4.16
[root@localhost nagios-plugins-1.4.16]# ./configure --prefix=/usr/local/nagios/
[root@localhost nagios-plugins-1.4.16]# make && make install
