Nagios Map Error After Upgrade

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
gerryrcom
Posts: 5
Joined: Wed Jul 06, 2016 4:26 am

Nagios Map Error After Upgrade

Post by gerryrcom »

Hi All

Just upgraded 4.0.8 to 4.1.1, all seems to we working apart from the new map. The legacy map works fine. Screen grab attached of what I'm seeing. When I look at the NAGIOSerror.log I'm getting the following:

[Wed Jul 06 09:40:45.154456 2016] [cgi:error] [pid 2764] [client xxx.xxxx.x.xxx:27879] script not found or unable to stat: /usr/lib/cgi-bin/objectjson.cgi, referer: http://hostname.dom.com/map.html?host=all

When I look in /usr/lib/cgi-bin/ there are no files, the files its looking for are /opt/nagios/sbin/ and when I look at the config file /etc/apache2/conf-enabled/nagios-serve-cgi-bin.conf it looks like the path is correctly configured:

<IfDefine ENABLE_USR_LIB_CGI_BIN>
ScriptAlias /nagios/cgi-bin/ /opt/nagios/sbin/
ScriptAlias /cgi-bin/nagios/ /opt/nagios/sbin/
<Directory "/opt/nagios/sbin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Require all granted
</Directory>
</IfDefine>

Is there somewhere else that the path could be defined that would be overwriting the above?
Appreciate any help
Gerry
Attachments
nagiosMapError.jpg
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Nagios Map Error After Upgrade

Post by ssax »

As a test, try changing it to this, restart apache, and see if it resolves the issue:

Code: Select all

<IfDefine ENABLE_USR_LIB_CGI_BIN>
ScriptAlias /nagios/cgi-bin/ /opt/nagios/sbin/
ScriptAlias /cgi-bin/nagios/ /opt/nagios/sbin/
ScriptAlias /usr/lib/cgi-bin/ /opt/nagios/sbin/
<Directory "/opt/nagios/sbin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Require all granted
</Directory>
</IfDefine>
Let us know the results.

Thank you
gerryrcom
Posts: 5
Joined: Wed Jul 06, 2016 4:26 am

Re: Nagios Map Error After Upgrade

Post by gerryrcom »

Thanks for the reply and suggestion, tried that but same error. I also had a look in the map.html and change the cgiurl variable value to /opt/nagios/sbin/ but no joy either.

Anywhere else that path could be coming from?
Thanks
Gerry
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Nagios Map Error After Upgrade

Post by tmcdonald »

How did you perform the initial install? Likely you supplied the ./configure script with a set of paths to get it to install under /opt/nagios/sbin. If you didn't do that for the upgrade, it probably recompiled all of the binaries to operate under the assumption that they are in /usr/lib/cgi-bin/. Can you dig through your history to get the parameters used in the upgrade?
Former Nagios employee
gerryrcom
Posts: 5
Joined: Wed Jul 06, 2016 4:26 am

Re: Nagios Map Error After Upgrade

Post by gerryrcom »

Hi,

I did set the path during install, I was following a book when setting Nagios up but I documented everything back then and used the same command for the upgrade:

sh configure --prefix=/opt/nagios --sysconfdir=/etc/nagios --localstatedir=/var/nagios --libexecdir=/opt/nagios/plugins --with-command-group=nagiosgroup

Thanks
Gerry
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Nagios Map Error After Upgrade

Post by tgriep »

Can you run the following on the Nagios server and post the output?

Code: Select all

ps -ef
ls -l /opt/nagios/sbin/
chage -l nagios
grep nag /etc/group
Also, can you post the log file from where you compiled Nagios 4.1.1?
Be sure to check out our Knowledgebase for helpful articles and solutions!
gerryrcom
Posts: 5
Joined: Wed Jul 06, 2016 4:26 am

Re: Nagios Map Error After Upgrade

Post by gerryrcom »

Finally got this working, may be a configuration issue but in addition to the apache2 conf-enabled/nagios-serve-cgi-bin.conf I also needed to change the ScriptAlias and path within conf-enabled/serve-cgi-bin.conf

So changed it to:

#ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ (commented out original value)
#<Directory "/usr/lib/cgi-bin"> (commented out original value)
ScriptAlias /cgi-bin/ /opt/nagios/sbin/
<Directory "/opt/nagios/sbin/">

Thanks for the help
gR
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Nagios Map Error After Upgrade

Post by mcapra »

Thanks for sharing your solution! Is it alright if we lock this thread and mark the issue as resolved?
Former Nagios employee
https://www.mcapra.com/
gerryrcom
Posts: 5
Joined: Wed Jul 06, 2016 4:26 am

Re: Nagios Map Error After Upgrade

Post by gerryrcom »

For sure, thanks.
Locked