安装nagiosql
1.yum -y install PHP-MysqL MysqL perl-DBI perl-dbd-mysql gcc glibc glibc-common gd gd-devel PHP-pear MysqL-devel perl gettext MysqL-server
重新编译PHP 加入--with-gettext --with-MysqL --enable-ftp
#./configure --prefix=/usr/local/PHP --with-apxs2=/usr/local/apache2/bin/apxs --with-zlib --with-gd --with-MysqLd --with-gettext --enable-ftp
#make
#make install
2.安装HTML_Template_IT,执行如下命令
# pear install HTML_Template_IT
3.Nagiosql下载地址:
http://nchc.dl.sourceforge.net/project/nagiosql/nagiosql/NagiosQL%203.2.0/nagiosql_320.tar.gz
解压,Nagiosql是一个WEB管理工具,只要把其放到下Apache即可。因为这里它要和Nagios整合到一起,为了方便管理,把其放在Nagios目录下
# mv nagiosql32 /usr/local/nagios/
# chown -R nagios:nagios /usr/local/nagios/nagiosql
修改config目录的访问权限,以使apache对其具有写权限,
# chmod -R 777 /usr/local/nagios/nagiosql/config
创建配置文件目录,并修改权限
mkdir -p /etc/nagiosql/{hosts,services,backup/{,hosts,services},import}
chown -R apache:nagios /etc/nagiosql/
chmod -R 755 /etc/nagiosql
chmod 777 /usr/local/nagios/nagiosql/config
在install下创建ENABLE_INSTALLER文件
[root@localhost rpm]# cd /usr/local/nagios/nagiosql/install/
[root@localhost install]# touch ./ENABLE_INSTALLER
[root@localhost install]# vim /usr/local/apache2/conf/httpd.conf
修改apache的httpd.conf,在其后面加入以下语句:
Alias /nagiosql "/usr/local/nagios/nagiosql" <Directory "/usr/local/nagios/nagiosql"> # SSLRequireSSL Options None AllowOverride None Order allow,deny Allow from all </Directory>
[root@localhost install]# /usr/local/apache2/bin/apachectl restart
[root@localhost install]# service MysqLd restart
进入http://IP/nagiosQL 提示以下错误
Fatal error: Call to undefined function gettext() in /usr/local/nagios/nagiosql/functions/translator.PHP on line 21
重新编译PHP 加入--with-gettext --with-MysqL --enable-ftp
./configure --prefix=/usr/local/PHP --with-apxs2=/usr/local/apache2/bin/apxs --with-zlib --with-gd --with-gettext --with-MysqL --enable-ftp