Configure NagiosQL3
Requirements
- Webserver e.g. Apache 1.x or above
- PHP 4.3 or above
- MySQL 4.1 or above
- Nagios 2 or above
- PEAR Module: HTML_Template_IT 1.1 or above
- PHP Extension: gettext
- PHP Extension: mysql
- PHP Extension: ftp
- Javascript enabled at your Webbrowser
Installation
HTML_Template_IT
Pear modules can be installed automatically by invoking the following command (requires Internet access):# pear install HTML_Template_IT
Locales
The NagiosQL translation depends on gnu-gettext and this framework depends on your locale system settings. Make sure you have the appropriate locale installed on your system (e.g. en-GB.utf-8). Please verify that by executing "locale -a".NagiosQL
Download and extract
Download the latest NagiosQL Version from www.nagiosql.org and extract the nagiosql-*.tar.gz to a directory accessible by your webserver (e.g. /srv/www/htdocs). A subdirectory "nagiosql" will be created:# cd /srv/www/htdocs/
# wget http://downloads.sourceforge.net/project/nagiosql/nagiosql/NagiosQL%203.0.3/nagiosql303.zip?use_mirror=nchc
# cp nagiosql303.zip /srv/www/htdocs/ # unzip nagiosql303.zip
Configuration
Directory Structure
It is recommend to have the following directory structure (you can change the directory names in your NagiosQL Domain Configuration):/etc/nagiosql/ -> Common configuration files " /hosts -> Host configuration files " /services -> Service configuration files " /backup/ -> Backups of the common configuration files " " /hosts -> Backups of the host configuration files " " /services -> Backups of the service configuration files
Nagios
In order to find the configuration files generated by NagiosQL your Nagios configuration must be amended, too. You are free to change the directory names, but be sure to do that in both configuration files (Nagios: nagios.cfg, NagiosQL: Domain Administration). The directory structure (e.g. backup directories below main directories) should never be changed!The Nagios configuration file nagios.cfg should be amended to follow the above recommendation:
cfg_file=/etc/nagiosql/contacttemplates.cfg cfg_file=/etc/nagiosql/contactgroups.cfg cfg_file=/etc/nagiosql/contacts.cfg cfg_file=/etc/nagiosql/timeperiods.cfg cfg_file=/etc/nagiosql/commands.cfg
cfg_file=/etc/nagiosql/hostgroups.cfg cfg_file=/etc/nagiosql/servicegroups.cfg cfg_dir=/etc/nagiosql/hosts cfg_dir=/etc/nagiosql/services
And optional:
cfg_file=/etc/nagiosql/hosttemplates.cfg cfg_file=/etc/nagiosql/servicetemplates.cfg cfg_file=/etc/nagiosql/servicedependencies.cfg cfg_file=/etc/nagiosql/serviceescalations.cfg cfg_file=/etc/nagiosql/hostdependencies.cfg cfg_file=/etc/nagiosql/hostescalations.cfg cfg_file=/etc/nagiosql/hostextinfo.cfg cfg_file=/etc/nagiosql/serviceextinfo.cfg
Permissions
The following file permissions are required to let NagiosQL read and write the Nagios configuration files. In our example the Apache runs as user "www-data" and the group "www-data" as well as Nagios runs by the user "nagios" and the group "nagios". Instead of the below configuration, you could also add the Apache user to the Nagios group. The configuration files are located at /etc/nagiosql. Please amend if this differs from your installation.## Nagios Main Configuration Files # chgrp www-data /etc/nagios # chgrp www-data /etc/nagios/nagios.cfg # chgrp www-data /etc/nagios/cgi.cfg # chmod 775 /etc/nagios # chmod 664 /etc/nagios/nagios.cfg # chmod 664 /etc/nagios/cgi.cfg ## NagiosQL Configuration
# chmod 6755 /etc/nagiosql # chown www-data.nagios/etc/nagiosql # chmod 6755 /etc/nagiosql/hosts # chown www-data.nagios/etc/nagiosql/hosts # chmod 6755 /etc/nagiosql/services # chown www-data.nagios /etc/nagiosql/services ## NagiosQL Backup Configuration # chmod 6755 /etc/nagiosql/backup # chown www-data.nagios /etc/nagiosql/backup # chmod 6755 /etc/nagiosql/backup/hosts # chown www-data.nagios /etc/nagiosql/backup/hosts # chmod 6755 /etc/nagiosql/backup/services # chown www-data.nagios /etc/nagiosql/backup/services ## Amend already existing files # chmod 644 /etc/nagiosql/*.cfg # chown www-data.nagios /etc/nagiosql/*.cfgIf these directories already have files, amend the permissions for them, too:
# chmod 644 /etc/nagiosql/hosts/*.cfg # chown www-data.nagios /etc/nagiosql/hosts/*.cfg # chmod 644 /etc/nagiosql/services/*.cfg # chown www-data.nagios /etc/nagiosql/services/*.cfgThe Nagios binary must be executable by the Apache user:
# chown nagios.www-data /usr/sbin/nagios # chmod 750 /usr/sbin/nagiosBe sure the Apache user is able to write the Nagios commandfile. Please check your nagios.cfg for the correct path to the commandfile!
# chown nagios.www.data /usr/local/nagios/var/rw/nagios.cmd # chmod 660 /usr/local/nagios/var/rw/nagios.cmd
Verify Installation and Configuration
Please execute as the webserver user "nagios -v /etc/nagios/nagios.cfg" and check for additional permissions.Running NagiosQL
Now you should be able start NagiosQL: http://www.domain.tld/nagiosql/index.phpThe Installation Wizard will help you installing NagiosQL.
No comments:
Post a Comment