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+ tab h3. Create a new site [Domain] * Domain: *monitor.example.com* nagios.example.com * +Disable+: *CGI* *Enable* CGI; *Disable* SuExec * +Disable+: *SuExec* * +Enable+: *SSL* [Options] * Append to the following to the PHP basedir: basedir <pre> :/usr/lib/cgi-bin/nagios3:/usr/share/nagios3/htdocs:/etc/nagios3/stylesheets :/usr/lib/cgi-bin/nagios3:/usr/share/nagios3/htdocs </pre> * Add the following Apache directive (Taken (Modified from the @/etc/nagios3/apache2.conf@): <pre> # apache configuration for nagios 3.x ScriptAlias /cgi-bin /cgi-bin/nagios3 /usr/lib/cgi-bin/nagios3 # Where the stylesheets (config files) reside Alias /stylesheets /nagios3/stylesheets /etc/nagios3/stylesheets Alias /nagios3 /usr/share/nagios3/htdocs # Where the HTML #Added for processing php pages live DocumentRoot /usr/share/nagios3/htdocs <DirectoryMatch (/usr/share/nagios3/htdocs|/usr/lib/cgi-bin/nagios3|/etc/nagios3/stylesheets)> AddType application/x-httpd-php .php .php3 .php4 .php5 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 @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@.