nagiosql320的安装及中文界面的问题
1.下载nagiosql320及补丁
wget http://110.96.192.8:83/1Q2W3E4R5T6Y7U8I9O0P1Z2X3C4V5B/jaist.dl.sourceforge.net/project/nagiosql/nagiosql/NagiosQL%203.2.0/nagiosql_320.tar.bz2
wget http://110.96.193.8:82/1Q2W3E4R5T6Y7U8I9O0P1Z2X3C4V5B/jaist.dl.sourceforge.net/project/nagiosql/nagiosql/NagiosQL%203.2.0/nagiosql_320_service_pack_2_additional_fixes_only.zip
2.解压并复制到相应目录
tar jxvf nagiosql_320.tar.bz2 unzip nagiosql_320_service_pack_2_additional_fixes_only.zip \cp -rf NagiosQL_3.2.0_SP2/* nagiosql32/ mv nagiosql32 /var/www/html/ cd /var/www/html/ chown -R apache.apache nagiosql32/ mkdir -pv /etc/nagiosql/{hosts,services,backup/{hosts,services}} mkdir -pv /etc/nagios/ chown -R apache.apache /etc/nagiosql/ chown -R apache.apache /etc/nagios/
4.配置虚拟主机
cd /etc/httpd/conf.d/ vi nagiosql.conf Alias /nagiosql "/var/www/html/nagiosql32" <Directory "/var/www/html/nagiosql32"> Options Indexes MultiViews FollowSymLinks AllowOverride None Order allow,deny Allow from all </Directory>
5. 重启httpd:
service httpd configtest service httpd restart
6.安装ssh2
yum -y install php-devel libssh2 libssh2-devel wget http://pecl.php.net/get/ssh2-0.12.tgz tar zxf ssh2-0.12.tgz cd ssh2-0.12 phpize ./configure make && make install vi /etc/php.d/ssh2.ini extension=ssh2.so
7.创建数据库并导入
mysql -uroot -p -e "create database db_nagiosql_v3;grant all on db_nagiosql_v3.* to nagiosql identified by 'nagiosql'"
update user set password=password('yourootpass') where user='root';//更新root帐号密码,如果没有设置的话
8.目录授权
chmod -R 777 /var/www/html/nagiosql32/config
9.访问web页面并进行安装
http://localhost/nagiosql/install/install.php
会出现下面这样的提示,无需理会,选“NEXT”
Settings file does not exist (config/settings.php): will be created
Database name * db_nagiosql_v3 //填写刚才创建的数据库名称
NagiosQL DB User * nagiosql //填写刚才创建好的数据库用户
NagiosQL DB Password * nagiosql //填写刚才创建好的数据库用户密码
Administrative Database User * root //填数据库管理员帐号
Administrative Database Password * ****** //填写数据库管理员帐号密码
Drop database if already exists? //勾选
Initial NagiosQL User * //nagiosql web登录帐号,默认为admin
Initial NagiosQL Password * //设置对应帐号的密码
Please repeat the password * //确认设置密码
Import Nagios sample config? //导入示例配置
Create NagiosQL config paths? //创建配置文件路径,勾选
10.nagiosql的配置,参照下图
11.修改界面为中文
12.nagios配置:注释掉原有的cfg_dir和cfg_file,添加如下代码
cfg_dir=/etc/nagiosql/hosts cfg_dir=/etc/nagiosql/services cfg_file=/etc/nagiosql/contacttemplates.cfg cfg_file=/etc/nagiosql/hostgroups.cfg cfg_file=/etc/nagiosql/serviceescalations.cfg cfg_file=/etc/nagiosql/servicetemplates.cfg cfg_file=/etc/nagiosql/commands.cfg cfg_file=/etc/nagiosql/hostdependencies.cfg cfg_file=/etc/nagiosql/serviceextinfo.cfg cfg_file=/etc/nagiosql/timeperiods.cfg cfg_file=/etc/nagiosql/contactgroups.cfg cfg_file=/etc/nagiosql/hostescalations.cfg cfg_file=/etc/nagiosql/hosttemplates.cfg cfg_file=/etc/nagiosql/servicegroups.cfg cfg_file=/etc/nagiosql/contacts.cfg cfg_file=/etc/nagiosql/hostextinfo.cfg cfg_file=/etc/nagiosql/servicedependencies.cfg
13.nagios控制:依次检查配置并重启nagios
14.中文界面问题:
发现修改后菜单栏依然不能汉化,而且当点击菜单栏后语言会恢复到英文,可以手工修改functions目录下的prepend_adm.php,具体如下:
编辑文件;vi functions/prepend_adm.php,修改 $strStoreLanguage = $_SESSION['SETS']['data']['locale']为 $strStoreLanguage = "zh_CN",修改后的效果如下所示:
if (isset($_SESSION['SETS']['data']['locale']) && ($_SESSION['SETS']['data']['locale'] != "")) $strStoreLanguage = "zh_CN";