Page 1 of 1

Nagios Map Error After Upgrade

Posted: Wed Jul 06, 2016 4:37 am
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

Re: Nagios Map Error After Upgrade

Posted: Wed Jul 06, 2016 2:05 pm
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

Re: Nagios Map Error After Upgrade

Posted: Thu Jul 07, 2016 3:52 am
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

Re: Nagios Map Error After Upgrade

Posted: Thu Jul 07, 2016 2:35 pm
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?

Re: Nagios Map Error After Upgrade

Posted: Fri Jul 08, 2016 2:36 am
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

Re: Nagios Map Error After Upgrade

Posted: Fri Jul 08, 2016 1:27 pm
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?

Re: Nagios Map Error After Upgrade

Posted: Mon Jul 11, 2016 10:19 am
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

Re: Nagios Map Error After Upgrade

Posted: Mon Jul 11, 2016 10:23 am
by mcapra
Thanks for sharing your solution! Is it alright if we lock this thread and mark the issue as resolved?

Re: Nagios Map Error After Upgrade

Posted: Mon Jul 11, 2016 10:33 am
by gerryrcom
For sure, thanks.