Page 1 of 1
I may missunderstood install process
Posted: Thu Mar 14, 2019 10:26 am
by fpussault
Hi,
I m installing a nagios server, following
https://assets.nagios.com/downloads/nag ... n/toc.html
until I test the apache access to the nagios Page : here we are OK
interface interrupted me with the error message :
Code: Select all
Not Found
The requested URL /nagios/cgi-bin/config.cgi was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
OK this seems logical...BUT
I have no docs about creating them, neither to download & create them nor any existing "*cgi*" directory installed nor any procedure talking about it.... So I am just stuck here.
What to do as next step ? where is the rest of documentation to follow ????
regards.
Of cours I needed it by Febuary 2019 ... in production ... else it wouldn't be fun...

Re: I may missunderstood install process
Posted: Thu Mar 14, 2019 1:26 pm
by mcapra
I would highly suggest following this documentation for installing Nagios Core:
https://support.nagios.com/kb/article/n ... ource.html
Re: I may missunderstood install process
Posted: Thu Mar 14, 2019 4:32 pm
by tgriep
Thanks mcapra for the help.
During the build process for Nagios, it should of created the config.cgi script when you ran the make command and the "make install" should of installed it.
The "make install-webconf" command should install the Web interface configuration files so you can access the GUI so make sure that command was ran.
What OS and release are you installing Nagios on?
Can you run these commands as root and post the output here?
Code: Select all
ls -l /usr/local/nagios/sbin
ps -ef --cols=300
Thanks
Re: I may missunderstood install process
Posted: Fri Mar 15, 2019 9:02 am
by fpussault
Hello,
I did all of :
Code: Select all
install install-base
install-cgis install-html
install-webconf install-config
install-init install-daemoninit
install-commandmode install-groups-users
install-exfoliation install-classicui
then I check as suggested the sbin subdirectory :
Code: Select all
-rwxrwxr-x 1 nagios nagios 320552 Mar 15 14:58 archivejson.cgi
-rwxrwxr-x 1 nagios nagios 305952 Mar 15 14:58 avail.cgi
-rwxrwxr-x 1 nagios nagios 301552 Mar 15 14:58 cmd.cgi
-rwxrwxr-x 1 nagios nagios 273096 Mar 15 14:58 config.cgi
-rwxrwxr-x 1 nagios nagios 314112 Mar 15 14:58 extinfo.cgi
-rwxrwxr-x 1 nagios nagios 244480 Mar 15 14:58 history.cgi
-rwxrwxr-x 1 nagios nagios 244464 Mar 15 14:58 notifications.cgi
-rwxrwxr-x 1 nagios nagios 322344 Mar 15 14:58 objectjson.cgi
-rwxrwxr-x 1 nagios nagios 240328 Mar 15 14:58 outages.cgi
-rwxrwxr-x 1 nagios nagios 240344 Mar 15 14:58 showlog.cgi
-rwxrwxr-x 1 nagios nagios 314128 Mar 15 14:58 status.cgi
-rwxrwxr-x 1 nagios nagios 320488 Mar 15 14:58 statusjson.cgi
-rwxrwxr-x 1 nagios nagios 256792 Mar 15 14:58 statuswml.cgi
-rwxrwxr-x 1 nagios nagios 244472 Mar 15 14:58 statuswrl.cgi
-rwxrwxr-x 1 nagios nagios 265000 Mar 15 14:58 summary.cgi
-rwxrwxr-x 1 nagios nagios 256808 Mar 15 14:58 tac.cgi
so here they are ? right ?
if so I can link them in apache settings ?
something like
Code: Select all
[...]
LoadModule cgi_module /usr/lib64/httpd/modules/mod_cgi.so
<Directory "/opt/application/.....................nagios/nagios/cgi-bin">
Options +ExecCGI
SetHandler cgi-script
</Directory>
I guess it is suffisant
& for information I use RHEL7.3 (without net access)

so it can sometimes be complicated to put a package on the server
THanks
Re: I may missunderstood install process
Posted: Fri Mar 15, 2019 10:30 am
by tgriep
Yes, the cgi scripts are in the sbin folder so that is good.
The Apache config file that should be installed on the server is here.
The contents of that file should look like this.
Code: Select all
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 Core"
AuthType Basic
AuthUserFile /usr/local/nagiosxi/etc/htpasswd.users
Require valid-user
Require all denied
</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 Core"
AuthType Basic
AuthUserFile /usr/local/nagiosxi/etc/htpasswd.users
Require valid-user
Require all denied
</Directory>
Make sure the file exists and that the contents are correct.
If you change anything in that file, restart Apache by running
If you still get the error when trying to access the Web interface, look in the Apache error logs in the following folder for any errors and resolve them if possible or post them here.