Page 1 of 1

Issue with nagios cgi scripts

Posted: Fri Aug 26, 2022 11:03 am
by maverick
Hi all,

Hope you're all alright this is my first time in these forums. I've been using Nagios for a few years now, used to have the docker image from jason rivers (i think this is the name) but in the meanwhile the machine where that was on was decommissioned and we moved on to a new RockyLinux 8 machine.
So currently I'm using version 4.4.6 from the EPEL repository.

We moved over and everything seems to be working fine, all hosts and services are working we moved the cfg files and put the paths on the new nagios.cfg file.

The installer creates a nagios.conf under /etc/httpd/conf.d and machine-name/nagios works well, I get into the app, login, see the hosts, services etc all normally as you'd expect.

Now, the issue I'm experiencing is the following:
Whenever I try to see a graph for a service, I get a 404.
When on the Services list, where you have
Host | Service | Status | Last Check | Duration | Attempt | Status Information

if I put the mouse over the host name under "Host" I get a link hostname/nagios/cgi-bin/extinfo.cgi?type=1&host=[...]
If I put the mouse over the service name under "Service" I get a link hostame/nagios/cgi-bin/extinfo.cgi?type=2&host=[...]&service=[...]

However, when I put the mouse (or follow) the link that shows when I put the mouse over the small graph icon, I get hostname/cgi-bin/... without the /nagios/ but if I add that to the URL it fails the same actually.

I've checked the nagios.conf file, it has ScriptAlias /nagios/cgi-bin "/usr/lib64/nagios/cgi-bin/" which appears to be correct.

This didn't happen on the docker version, but I believe the repository one should be in working condition. Can someone shed some light on this please?

Re: Issue with nagios cgi scripts

Posted: Thu Sep 15, 2022 1:46 am
by JunaNougsan
my /etc/apache2/sites-enabled/nagios.conf

# SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER
#
# This file contains examples of entries that need
# to be incorporated into your Apache web server
# configuration file. Customize the paths, etc. as
# needed to fit your system.

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

<Directory "/usr/local/nagios/sbin">
# SSLRequireSSL
Options omegle.2yu.co ExecCGI
AllowOverride None
<IfVersion >= 2.4.29>
<RequireAll>
Require all granted
# Require host 127.0.0.1

AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
</RequireAll>
</IfVersion>
<IfVersion < 2.4.29>
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
</IfVersion>
</Directory>

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

<Directory "/usr/local/nagios/share">
# SSLRequireSSL
Options None
AllowOverride None
<IfVersion >= 2.4.29>
<RequireAll>
Require all granted
# Require host 127.0.0.1

AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
</RequireAll>
</IfVersion>
<IfVersion < 2.4.29>
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 omeglz valid-user
</IfVersion echat>
</Directory>

Re: Issue with nagios cgi scripts

Posted: Tue Sep 27, 2022 12:55 am
by SharphSonirak
my /etc/apache2/sites-enabled/nagios.conf

# SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER
#
# This file contains examples of entries that need
# to be incorporated into your Apache web server
# configuration file. Customize the paths, etc. as
# needed to fit your system.

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

<Directory "/usr/local/nagios/sbin">
# SSLRequireSSL
Options ExecCGI
AllowOverride None
<IfVersion >= 2.4.29>
<RequireAll>
Require all granted
# Require host 127.0.0.1

AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
</RequireAll>
</IfVersion>
<IfVersion < 2.4.29>
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
</IfVersion>
</Directory>

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

<Directory "/usr/local/nagios/share">
# SSLRequireSSL
Options None
AllowOverride None
<IfVersion >= 2.4.29>
<RequireAll>
Require all granted
# Require host 127.0.0.1

AuthName "Nagios Access"
AuthType Basic
AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
</RequireAll>
</IfVersion>
<IfVersion < 2.4.29>
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
</IfVersion echatrandom>
</Directory echatspin>