首页 > 代码库 > nconf-1.3.0安装
nconf-1.3.0安装
安装nconf
安装前创建nconf数据库并建立用户及分配权限
mysql -u root -p
create database nconf;
grant all privileges on nconf.* to nconf@localhost identified by ‘nconf‘;
flush privileges;
安装nconf
[root@SZNAGIOS01 mnt]# tar zxvf nconf-1.3.0-0..tgz
[root@SZNAGIOS01 mnt]# mv nconf /var/www/html/
[root@SZNAGIOS01 mnt]# cd /var/www/html/nconf/
[root@SZNAGIOS01 nconf]# chown -R apache:apache config/ temp/ static_cfg/ output/
打开 http://192.168.7.164/nconf
设置连接数据库的参数:
配置nconft和nagiso路径(默认):
设置nconf管理密码:
修改配置文件:
[root@localhost nconf]# rm -rf INSTALL INSTALL.php UPDATE UPDATE.php
[root@localhost nconf]# ln -s /usr/local/nagios/bin/nagios bin/nagios
[root@localhost nconf]# chmod +x bin/generate_config.pl
[root@localhost nconf]# chown -R apache:apache temp
[root@localhost nconf]# chown -R apache:apache bin
[root@localhost nconf]# chmod +x bin/nagios
[root@localhost nconf]# chmod +x ADD-ONS/deploy_local.sh
登陆测试:
导入配置文件:
[root@localhost nconf]# ADD-ONS/deploy_local.sh
Running configuration check...done.
Reloading nagios configuration...done
之后会在/usr/local/nagios/etc/目录中生成以下目录Default_collector与global
修改nagios配置文件:
将原来的配置文件(cfg_file=***)注释加上最后两行
[root@localhost nconf]# vim /usr/local/nagios/etc/nagios.cfg
#cfg_file=/usr/local/nagios/etc/objects/commands.cfg
#cfg_file=/usr/local/nagios/etc/objects/contacts.cfg
#cfg_file=/usr/local/nagios/etc/objects/timeperiods.cfg
#cfg_file=/usr/local/nagios/etc/objects/templates.cfg
#cfg_file=/usr/local/nagios/etc/objects/localhost.cfg
cfg_dir=/usr/local/nagios/etc/Default_collector
cfg_dir=/usr/local/nagios/etc/global
重启nagios:
service nagios restart
本文出自 “星空” 博客,请务必保留此出处http://liuxiaolan.blog.51cto.com/7789055/1439559