nagios插件nagiosql安装配置

nagios插件nagiosql安装配置

 

# Nagiosql install

[root@Cagios ~]# yum install -y libssh2 libssh-devel
[root@Cagios ~]# cd /usr/local/src
[root@Cagios src]# wget http://pecl.php.net/get/ssh2-0.12.tgz
[root@Cagios ssh2-0.12]# phpize
[root@Cagios ssh2-0.12]# ./configure --with--ssh2
[root@Cagios ssh2-0.12]# make && make install
[root@Cagios ~]# vi /etc/php.d/ssh2.ini
extension=ssh2.so

wget http://nchc.dl.sourceforge.net/project/nagiosql/nagiosql/NagiosQL%203.2.0/nagiosql_320.tar.gz

# nagiosql 权限设置
[root@Cagios src]# tar zxf nagiosql_320.tar.gz
[root@Cagios src]# mv nagiosql/ /usr/local/nagios/
[root@Cagios ~]# cd /usr/local/nagios/nagiosql/
[root@Cagios nagiosql]# chmod 777 config/
[root@Cagios nagiosql]# chown -R nagios:nagcmd *
[root@Cagios nagiosql]# find . -type d -exec chmod 775 {} \;
[root@Cagios nagiosql]# find . -type f -exec chmod 664 {} \;



# 配置nagiosql文件写路径及权限
[root@Cagios ~]# mkdir -p /etc/nagiosql/backup/hosts
[root@Cagios ~]# mkdir -p /etc/nagiosql/backup/services
[root@Cagios ~]# mkdir -p /etc/nagiosql/hosts
[root@Cagios ~]# mkdir -p /etc/nagiosql/services
[root@Cagios ~]# chown -R nagios:nagcmd /etc/nagiosql
[root@Cagios ~]# chmod -R 775 /etc/nagiosql
[root@Cagios ~]# chown -R nagios.nagcmd /usr/local/nagios



# 配置apache
[root@Cagios ~]# vi /etc/httpd/conf.d/nagios.conf
Alias /nagiosql "/usr/local/nagios/nagiosql"
<Directory "/usr/local/nagios/nagiosql">
  # SSLRequireSSL  
  Options None  
  AllowOverride None  
  Order allow,deny
  Allow from all
</Directory>


# 编辑nagios配置文件,注释以cfg开头的配置,并添加
vim /usr/local/nagios/etc/nagios.cfg
## Timeperiods
cfg_file=/etc/nagiosql/timeperiods.cfg
## Commands
cfg_file=/etc/nagiosql/commands.cfg
## Contacts
cfg_file=/etc/nagiosql/contacts.cfg
cfg_file=/etc/nagiosql/contactgroups.cfg
cfg_file=/etc/nagiosql/contacttemplates.cfg
## Hosts
cfg_dir=/etc/nagiosql/hosts
cfg_file=/etc/nagiosql/hosttemplates.cfg
cfg_file=/etc/nagiosql/hostgroups.cfg
cfg_file=/etc/nagiosql/hostextinfo.cfg
cfg_file=/etc/nagiosql/hostescalations.cfg
cfg_file=/etc/nagiosql/hostdependencies.cfg
## Services
cfg_dir=/etc/nagiosql/services
cfg_file=/etc/nagiosql/servicetemplates.cfg
cfg_file=/etc/nagiosql/servicegroups.cfg
cfg_file=/etc/nagiosql/serviceextinfo.cfg
cfg_file=/etc/nagiosql/serviceescalations.cfg
cfg_file=/etc/nagiosql/servicedependencies.cfg



# 安装页面
http://192.168.88.128/nagiosql/install/

 

 

 

 

 

 

 

posted @ 2015-12-05 14:50  ca0guo  阅读(554)  评论(1编辑  收藏  举报