Feature #52
Updated by Daniel Curtis almost 12 years ago
By default, Ubuntu will not configure Nagios upon installation. This guide will show how to install Nagios on an Ubuntu system running a common LAMP setup with ISPConfig 3 h2. Install Nagios 3, Plugins, MySQL Support <pre> sudo apt-get install nagios3 nagios-plugins nagios-nrpe-plugin ndoutils-nagios3-mysql </pre> * Set password for @nagiosadmin@ user * Confirm password * Enter MySQL @root@ password * Create Nagios database password h2. Setup host in ISPConfig * Navigate to the +[Site]+ +Site+ tab h3. Create a new site [@Domain@] [Domain] * Domain: *monitor.example.com* * +Disable+: *CGI* * +Disable+: *SuExec* * +Enable+: *SSL* [@Options@] [Options] * Append to the following to the PHP basedir: <pre> :/usr/lib/cgi-bin/nagios3:/usr/share/nagios3/htdocs:/etc/nagios3/stylesheets </pre> * Add the following Apache directive (Taken from the @/etc/nagios3/apache2.conf@): <pre> # apache configuration for nagios 3.x ScriptAlias /cgi-bin/nagios3 /cgi-bin /usr/lib/cgi-bin/nagios3 # Where the stylesheets (config files) reside Alias /stylesheets /etc/nagios3/stylesheets # Where the HTML pages live # Changed "Alias" directive to "DocumentRoot" as Nagios 3 is installed via apt and is located outside the default web directory. DocumentRoot /usr/share/nagios3/htdocs <DirectoryMatch (/usr/share/nagios3/htdocs|/usr/lib/cgi-bin/nagios3|/etc/nagios3/stylesheets)> Options FollowSymLinks DirectoryIndex index.php index.html AllowOverride AuthConfig Order Allow,Deny Allow From All AuthName "Nagios Access" AuthType Basic AuthUserFile /etc/nagios3/htpasswd.users require valid-user </DirectoryMatch> <Directory /usr/share/nagios3/htdocs> Options +ExecCGI </Directory> </pre> At this point Nagios should be work by going to @monitor.example.com/@. @nagios.example.com/nagios3/@, next I will set symbolic links to allow the root directory to work instead of using the @nagios3/@ directory. h3. Setting Symbolic Links * Backup existing @web@ and @cgi-bin@ folders, create link to new @web@ and @cgi-bin@ folder, create link within @web@ folder to the @stylesheets@ folder. <pre> cd /var/www/nagios.example.com/ mv web web.bak && mv cgi-bin cgi-bin.bak ln -s /usr/share/nagios3/htdocs web ln -s /usr/lib/cgi-bin/nagios3 cgi-bin ln -s /etc/nagios3/stylesheets /var/www/nagios.example.com/web/stylesheets </pre> Now Nagios should be visible from @nagios.example.com@.