Revision of Web Interface from Sun, 06/01/2008 - 18:09

Revisions allow you to track differences between multiple versions of your content, and revert back to older versions.

Apache Configuration
Add the following to /usr/local/apache2/conf/httpd.conf:

ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"

<Directory "/usr/local/nagios/sbin">
#  SSLRequireSSL
   Options ExecCGI
   AllowOverride None
   Order allow,deny
   Allow from all
#  Order deny,allow
#  Deny from all
#  Allow from 127.0.0.1
   AuthName "Nagios Access"
   AuthType Basic
   AuthUserFile /usr/local/nagios/etc/htpasswd.users
   Require valid-user
</Directory>

Alias /nagios "/usr/local/nagios/share"

<Directory "/usr/local/nagios/share">
#  SSLRequireSSL
   Options None
   AllowOverride None
   Order allow,deny
   Allow from all
#  Order deny,allow
#  Deny from all
#  Allow from 127.0.0.1
   AuthName "Nagios Access"
   AuthType Basic
   AuthUserFile /usr/local/nagios/etc/htpasswd.users
   Require valid-user
</Directory>

Lighttpd Configuration
If you are using Lighttpd instead of Apache, you'll need to make some modifications to your lighttpd.conf file.
Firstly, you'll need to ensure you have the required modules loaded. At a minimum, you will need:

server.modules = (
"mod_cgi",
"mod_auth",
"mod_alias",
)
<code>
alias.url =     (
                "/nagios/cgi-bin" => "/usr/local/nagios/sbin",
                "/nagios" => "/usr/local/nagios/share"
                )

$HTTP["url"] =~ "^/nagios/cgi-bin" {
        cgi.assign = ( "" => "" )
}

Add the Authentication configuration:

$HTTP["url"] =~ "^/nagios/cgi-bin" {
        auth.backend = "htpasswd"
        auth.backend.htpasswd.userfile = "/usr/local/nagios/etc/htpasswd.users"
        auth.require = ( "" => (
                "method" => "basic",
                "realm" => "Nagios Access",
                "require" => "user=nagiosadmin"
                )
        )
}

$HTTP["url"] =~ "^/nagios" {
        auth.backend = "htpasswd"
        auth.backend.htpasswd.userfile = "/usr/local/nagios/etc/htpasswd.users"
        auth.require = ( "" => (
                "method" => "basic",
                "realm" => "Nagios Access",
                "require" => "user=nagiosadmin"
                )
        )
}

The Lighttpd wiki also has a Nagios installation tutorial.
Password Security

Create the password file and an admin user:

/usr/local/apache2/bin/htpasswd -c /usr/local/nagios/etc/htpasswd.users <username>

If you don't have the htpasswd program, you can always use one of the web-based programs to create entries for the /usr/local/nagios/etc/htpasswd.users file.

Want to be able to execute commands from the web interface? You'll need to edit /usr/local/nagios/etc/nagios.cfg to enable external commands:

check_external_commands=1

Recent Updates

  • 10 months 1 day ago
    1.27.2 update
  • 10 months 1 week ago
    Drupal 10/11 config
  • 10 months 2 weeks ago
  • PHP
    10 months 2 weeks ago
    PHP 8.3.11 and AlmaLinux
  • 10 months 2 weeks ago
    New version of Pound
Error | Production Monkeys

Error

The website encountered an unexpected error. Please try again later.