Installing
Prerequisites
- Apache web server
- MySQL Server version 4.1 or above
- PHP version 5.2 or above
- Nagios 2.x or 3.x
- Additional PHP Modules:
- session
- MySQL
- gettext
- filter
- ftp(for FTP connections to remote servers)
- ssh
yum -y install php-devel libssh2-devel pecl install -f ssh2 echo "extension=ssh2.so" >> /etc/php.ini service httpd restart
php -m | grep ssh2 명령을 통하여 모듈이 로드되어있는지 확인 할 수 있다.
Prepare directory structure
mkdir -p /etc/nagiosql/{hosts,services}
mkdir -p /etc/nagiosql/backup/{hosts,services}
chown -R apache:icinga /etc/nagiosql
Icinga configuration files
chown apache:icinga /usr/local/icinga/etc/icinga.cfg
chown apache:icinga /usr/local/icinga/etc/cgi.cfg
chown apache:icinga /usr/local/icinga/var/rw/icinga.cmd
chgrp apache /usr/local/icinga/etc /usr/local/icinga/var/spool
chmod 640 /usr/local/icinga/etc/{icinga.cfg,cgi.cfg}
chmod 660 /usr/local/icinga/var/rw/icinga.cmd
- chgrp apache /usr/local/icinga/etc 는 Tools -> Nagios config 메뉴를 통하여 설정파일을 수정할 수 있게 함
- chgrp apache /usr/local/icinga/var/spool 는 Tools -> Nagios control -> Check configuration files 메뉴 실행시 Nagios가 재시작 가능한지 여부를 체크하기 위함
Install NagiosQL
tar zxvf nagiosql_320.tar.gz -C /opt/
mv /opt/nagiosql32 /opt/nagiosql
chown -R apache /opt/nagiosql
chmod 750 /opt/nagiosql/config
Prepare PHP configuration
...생략...
file_uploads = On
...생략...
session.auto_start = 0
...생략...
date.timezone = "Asia/Seoul"
...생략...
Prepare Apache configuration
/etc/httpd/conf.d/nagiosql.conf
#NAGIOSQL SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER
#Last Modified: 03-24-2011
#This file contains examples of entries that need
#to be incorporated into your Apache web server
#configuration file. Customize the paths, etc. as
#needed to fit your system.
Alias /nagiosql "/opt/nagiosql"
<Directory "/opt/nagiosql">
Options None
AllowOverride None
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
# AuthName "NagiosQL Access"
# AuthType Basic
# AuthUserFile /etc/nagiosql/auth/nagiosql.users
# Require valid-user
</Directory>
service httpd restart
NagiosQL Installer
http://<IP>/nagiosql
MySQL nagiosql_user password : prab8Ute
Nagios config path : /usr/local/icinga/etc/
Apply Service Pack 2
unzip nagiosql_320_sp2.zip -d /tmp
chown -R apache: /tmp/NagiosQL_3.2.0_SP2
cp -vfr /tmp/NagiosQL_3.2.0_SP2/* /opt/nagiosql/
Delete NagiosQL Installer
rm -rf /opt/nagiosql/install
Configuration
Check Icinga Configuration file(icinga.cfg)
NagioSQL은 다음 파일을 사용한다고 가정하므로 반드시 다음 항목들이 icinga.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
No comments:
Post a Comment