Page 1 of 1

Nagios 4 on Raspbian Buster

Posted: Thu Apr 23, 2020 5:30 pm
by dwsdad
I'm wanting to play around with Nagios a little and decided my Pi4 was a good candidate. I used the Software Manager in Buster to install Nagios 4 and all seemed to go well. But when I tried to access the webpage (http://<host addr>/nagios4, I got a 404 error from Apache. After doing some research and digging around, I ran systemctl status apache2.service, which produced:
:~ $ systemctl status apache2.service
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2020-04-22 20:30:24 CDT; 20h ago
Docs: https://httpd.apache.org/docs/2.4/
Process: 3672 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)

Apr 22 20:30:24 NAS systemd[1]: Starting The Apache HTTP Server...
Apr 22 20:30:24 NAS apachectl[3672]: AH00526: Syntax error on line 37 of /etc/apache2/conf-enabled/nagios4-cgi.conf:
Apr 22 20:30:24 NAS apachectl[3672]: Invalid command 'AuthDigestDomain', perhaps misspelled or defined by a module n
Apr 22 20:30:24 NAS apachectl[3672]: Action 'start' failed.
Apr 22 20:30:24 NAS apachectl[3672]: The Apache error log may have more information.
Apr 22 20:30:24 NAS systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
Apr 22 20:30:24 NAS systemd[1]: apache2.service: Failed with result 'exit-code'.
Apr 22 20:30:24 NAS systemd[1]: Failed to start The Apache HTTP Server.

So then I pulled up the conf file shown from that output, and shows:
<Files "cmd.cgi">
AuthDigestDomain "Nagios4"
AuthDigestProvider file
AuthUserFile "/etc/nagios4/htdigest.users"
AuthGroupFile "/etc/group"
AuthName "Nagios4"
AuthType Digest
Require all granted
#Require valid-user
</Files>
</DirectoryMatch>

<Directory /usr/share/nagios4/htdocs>

So, what is that parameter supposed to set to (Invalid command 'AuthDigestDomain', perhaps misspelled or defined by a module n)? Thanks.

Re: Nagios 4 on Raspbian Buster

Posted: Fri Apr 24, 2020 5:00 pm
by jdunitz
Your setup is quite different than mine, but I think the issue is that somehow the paths to the files are wrong.

Does /usr/share/nagios4/htdocs actually exist, or is it in /usr/local/share? You could fix it with a symlink, or change the path in the config file; either one should work.

Also, check the location of your htdigest.users file.

Then restart apache, and see if it's happier with that.

--Jeffrey

Re: Nagios 4 on Raspbian Buster

Posted: Fri Apr 24, 2020 7:51 pm
by dwsdad
Thanks for the reply.

htdocs is where it should be - /usr/share/nagios4. htdigest.users is located in /etc/nagios4.

systemctl restart apache2 didn't help.

Re: Nagios 4 on Raspbian Buster

Posted: Wed Apr 29, 2020 3:15 pm
by jdunitz
Looking at: https://httpd.apache.org/docs/2.4/mod/m ... igest.html

It might be that you don't have the mod_auth_digest stuff fully configured. You already have the digest files created and so forth?
If not, you may need to run the htdigest command to create/setup the authentication stuff.