====== Setup Nagios 3 ====== This Howto explains how to set up [[http://www.nagios.org/|nagios]], so you can monitor your server. ===== 1. Install the nagios3 package ===== At first, you have to install the nagios3 package: # aptitude update && aptitude safe-upgrade # aptitude install nagios3 ===== 2. Create the necessary files and directories for the webinterface ===== You can't use the default apache-config-file which comes with nagios, because in ispCP, Websites have to be under /var/www. So you have to create a directory there, **/var/www/nagios** and copy the contents of /usr/share/nagios2/htdocs into this directory. # mkdir -p /var/www/nagios/htdocs # cp -R /usr/share/nagios3/htdocs/* /var/www/nagios/htdocs/ # cp -R /etc/nagios3/stylesheets/* /var/www/nagios/htdocs/ # cp -R /usr/share/nagios/htdocs/images/logos/* /var/www/nagios/htdocs/images/logos/ This directory has to be owned by the www-data - User: # chown -R www-data.www-data /var/www/nagios Now you can create a file **/etc/apache2/sites-available/nagios3.conf** with the following content: # # nagios3 Virtual Host Webinterface # ServerAdmin admin@yourdomain.com DocumentRoot /var/www/nagios/htdocs ServerName nagios.yourdomain.com ErrorLog /var/log/apache2/nagios.yourdomain.com-error.log CustomLog /var/log/apache2/nagios.yourdomain.com-access.log combined ScriptAlias /usr/lib/cgi-bin/nagios3 /var/www/nagios/cgi-bin ScriptAlias /nagios3/cgi-bin /var/www/nagios/cgi-bin Options FollowSymLinks DirectoryIndex index.html AllowOverride AuthConfig Order Allow,Deny Allow From All AuthName "Nagios Access" AuthType Basic AuthUserFile /etc/nagios3/htpasswd.users require valid-user Options ExecCGI AllowOverride None Order allow,deny Allow from all AuthName "Nagios Access" AuthType Basic AuthUserFile /etc/nagios3/htpasswd.users Require valid-user Before you save this Content please search # yourdomain.com and # xxx.xxx.xxx.xxx and replace this with you Data. Ready, please enable it with # a2ensite nagios3.conf In order to be able to run a subdomain like //nagios.yourdomain.com// you have to edit the files **/etc/apache2/sites-available/ispcp.conf** and **/etc/ispcp/apache/working/ispcp.conf**, go to the vhost-section of //yourdomain.com// and delete the //*.yourdomain.com// in this line: ServerAlias www.yourdomain.com yourdomain.com *.yourdomain.com After all this, you have to reload the apache configuration: # /etc/init.d/apache2 reload ===== 3. Change the nagios configuration ===== In the file **/etc/nagios3/cgi.cfg** you have to change the values //physical_html_path// and //url_html_path// as shown below: physical_html_path=/var/www/nagios/htdocs url_html_path=/ ===== 4. Create password file for nagios ===== Now you have to create a password file for nagios which has to be placed under **/etc/nagios3/htpasswd.users**: # htpasswd -c /etc/nagios3/htpasswd.users nagiosadmin New password: Re-type new password: ===== 5. Finished ===== Now, you should be able to access nagios via [[http://nagios.yourdomain.com]], login with the username **nagiosadmin** and the password specified under 4. The nagios configuration is done under /etc/nagios3/, you find the nagios documentation here: [[http://nagios.sourceforge.net/docs/3_0/]] **Regards scysys ^^**