Nagios

Nagios offers complete monitoring and alerting for servers, switches, applications, and services.

Web server
Decide which web server will be to used and set it up:


 * Apache with PHP
 * Lighttpd with PHP
 * Nginx with PHP and fcgiwrap

Once finished return here to and continue reading.

USE flags
Set the proper USE flags for Nagios before it emerging it:

Do not forget to enable the right USE flags for Nagios plugins.

Emerge
Finally install :

Apache
Enable the Nagios module for Apache:

Since Nagios requires PHP for its web interface, it may needed to be enabled as well if it has not been previously. One way is to simply add  to   and edit  This should be fine unless PHP is needed for purposes other than hosting Nagios.

If using Apache 2.4 (which is still marked unstable as of April 2015) the file may need to be modified to fit the new authorization directives of Apache 2.4.

Remember to add the  user to group  :

Restart the Apache service to have it recognize the group change:

Lighttpd
Enable the Nagios configuration for Lighttpd:

Configure authentication. More information on how to set this up can be found in the Lighttpd documentation.

Restart the Lighttpd service:

Nginx
See the Nginx guide before continuing if you don't have it already setup.

Emerge and :

Next, create an init script for a spawn-fcgi instance dedicated to nagios:

Then, configure our spawn-fcgi instance to launch fcgiwrap and listen on a unix socket:

Don't forget to add spawn-fcgi.nagios to the default runlevel and start it:

You may need to change the owner of the /var/nagios folder, so fcgiwrap can access it:

Nginx can now be configured to serve our nagios instance. Here's an example configuration snippet for nginx, assuming you have defined a php upstream:

Permissions
Add the user name(s) to the  group, whom are allowed access to the Nagios service:

Once done, completely sign out from all shells and re-login for the update to apply.

Boot service
Start Nagios:

To start Nagios at boot time, add it the default runlevel:

Testing
Open a browser and navigate to http://localhost/nagios