4 月 162013
 

……44

dsdf

[root@localhost nagios]# useradd nagios -s /sbin/nologin
[root@localhost nagios]# groupadd nagcmd
[root@localhost nagios]#
[root@localhost nagios]# usermod -a -G nagcmd nagios
[root@localhost nagios]# usermod -a -G nagcmd apache

安装编译工具

yum install gcc make

编译Nagios时缺少GD相关软件开发包

*** GD, PNG, and/or JPEG libraries could not be located... *********

安装GD及相关软件开发包

[root@localhost nagios]# yum install gd-devel libpng-devel libjpeg-devel

nagios-install-01

编译安装

[root@localhost nagios]# ./configure --prefix=/usr/local/nagios \
> --with-nagios-user=nagios --with-nagios-group=nagios \
> --with-command-user=apache --with-command-group=nagcmd
[root@localhost nagios]# make all
[root@localhost nagios]# make install
[root@localhost nagios]# make install-init
[root@localhost nagios]# make install-config
[root@localhost nagios]# make install-commandmode
[root@localhost nagios]# make install-webconf

生成登录用户及密码

[root@localhost nagios]# htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
 New password:
 Re-type new password:
 Adding password for user nagiosadmin
[root@localhost nagios]#

 

service httpd restart

错误分析

make[2]: *** [check_http.o] Error 1
make[2]: Leaving directory `/root/nagios-plugins-1.4.16/plugins'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/nagios-plugins-1.4.16'
make: *** [all] Error 2

yum install openssl-devel

[root@localhost nagios-plugins-1.4.16]#
./configure –with-nagios-user=nagios –with-nagios-group=nagios
[root@localhost ~]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
[root@monitor ~]# chkconfig –add nagios
[root@monitor ~]# service nagios start
Starting nagios:This account is currently not available.
done.
[root@monitor ~]#

nagios-install-02

nagios-install-03

 

nagios-install-04

 

nagios-install-05

 

nagios-install-06

相关下载:
(1) Nagios Core 3.5.0 (2) Nagios Plugin 1.4.16