Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I recently installed Nagios on an EC2 instance running AmazonLinux (which is basically SuSe, to my understanding). I'm using lighttpd and mod_cgi to serve the web interface.

When I navigate to a page, instead of getting the actual content, I get this:

Nagios Core 3.3.1
Copyright (c) 2009-2011 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 07-25-2011
License: GPL

Website: http://www.nagios.org
Usage: /usr/sbin/nagios [options] 

Options:

  -v, --verify-config          Verify all configuration data
  -s, --test-scheduling        Shows projected/recommended check scheduling and other
                               diagnostic info based on the current configuration files.
  -x, --dont-verify-paths      Don't check for circular object paths - USE WITH CAUTION!
  -p, --precache-objects       Precache object configuration - use with -v or -s options
  -u, --use-precached-objects  Use precached object config file
  -d, --daemon                 Starts Nagios in daemon mode, instead of as a foreground process

Visit the Nagios website at http://www.nagios.org/ for bug fixes, new
releases, online documentation, FAQs, information on subscribing to
the mailing lists, and commercial support options for Nagios.

Which appears to be the help document for the command-line version. Here's the relevant bit of my lighttpd.conf:

alias.url = (
                "/nagios/cgi-bin" => "/usr/sbin/nagios",
                "/nagios" => "/usr/share/nagios/html"
)

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

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

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

What am I doing wrong?

share|improve this question
    
ls -l /usr/sbin/nagios? grep mod_cgi /path/to/lighttpd.conf? –  quanta Aug 8 '12 at 7:34

1 Answer 1

up vote 1 down vote accepted

I figured it out. To people who find this on Google or whatever:

For some reason, the cgi-bin directory is actually installed in /usr/lib64/nagios/. I was pointing lighttpd at the actual executable for Nagios, which was why it was spitting out its help doc.

This is the section that needs to be changed:

alias.url = (
                "/nagios/cgi-bin" => "/usr/lib64/nagios/cgi-bin",
                "/nagios" => "/usr/share/nagios/html"
)
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.