nagios监控系统配置过程.doc篇文章是从网上看了很多资料,通过自己实践,测试可以完成服务器的基本监控,然后整理而成,希望可以帮助学习linux的朋友。
[color=Red][size=4][size=6]有很多朋友说我的文章和他做的有点出入,,,我也测试过了,,不要死定着这篇文章,文章只是引导大家去学习原理,配置文件的变动还需要大家去相应的改动。[/size][/size][/color]
实验环境:
主机名为nagios
主机名为apache
用到的软件包:httpd-、imagepak-、mysql--rc-linux-i686-icc-、nagios-、nagios-plugins-、nrpe-、perl-、php-、pnp-、rrdtool-
在监控服务器上进行下面的操作:
1)解压缩:
tar -zxvf nagios-
cd nagios-
./configure --prefix=/usr/local/nagios --with-gd-lib=/usr/local/lib --with-gd-inc=/usr/local/include
2)创建用户并且设定权限:
groupadd nagios
useradd -g nagios nagios
mkdir /usr/local/nagios
chown -R /usr/local/nagios
make all
make install [color=Red]//来安装主程序,CGI和HTML文件 [/color]
make install-init [color=Red]//在/etc/[/color]
make mandmode [color=Red]//来配置目录权限[/color]
make install-config
[color=Red]//来安装示例配置文件,安装的路径是/usr/local/nagios/etc[/color].
3)验证是否安装成功:
验证程序是否被正确安装。切换目录到安装路径(这里是/usr/local/nagios),看是否存在 etc、bin、 sbin、 share、 var这五个目录,如果存在则可以表明程序被正确的安装到系统了。后表是五个目录功能的简要说明:
bin Nagios执行程序所在目录,nagios文件即为主程序
etc Nagios配置文件位置,初始安装完后,只有几个*.cfg-sample文件
sbin Nagios Cgi文件所在目录,也就是执行外部命令所需文件所在的目录
share Nagios网页文件所在的目录
var Nagios日志文件、spid 等文件所在的目录
var/archives
Empty directory for the archived logs
/var/rw Empty directory for the mand file
1)解压缩:
tar -zxvf nagios-plugins-
cd nagios-plugins-
./configure --prefix=/usr/local/nagios/
[color=Red](在redhat系统上面安装可能出现configure时,到这里checking for redhat spopen problem...就不动了,所以需要在configure时再加上--enable-redhat-pthread-workaround )[/color]
make
make install
ls /usr/local/nagios/libexec/
会显示安装的插件文件,即所有的插件
nagios监控系统配置过程 来自淘豆网m.daumloan.com转载请标明出处.