Page 1 of 2
Error after upgrading from 3.2.3 to 3.5.1
Posted: Mon Oct 21, 2013 10:02 am
by gtneon99
After the upgrade from 3.2.3 to 3.5.1 I am getting the following error when clicking on the buttons to the Left side of the webpage.
Code: Select all
An error has occurred in the script on this page
Line: 9
Char: 1
Error: The value of the property '$' is null or undefined, not a Function object
Code: 0
I get the following error in the error_log file:
Code: Select all
[Mon Oct 21 09:58:21 2013] [error] [client <client ip address>] script not found or unable to stat: /usr/local/nagios/sbin/jquery-1.7.1.min.js, referer: http://<server ip address>/nagios/cgi-bin/status.cgi?hostgroup=all&style=hostdetail
Not really sure where to start on troubleshooting this one so any help would be appreciated.
Thanks,
David Williams
EDIT: I went ahead and took your ip out of the post - tmcdonald
------
I have found the file "jquery-1.7.1.min.js" but it does not exist in the location being specified by the error:
Code: Select all
# find / -name jquery-1.7.1.min.js
/etc/nagios/html/js/jquery-1.7.1.min.js
/etc/nagios/html/includes/jquery-1.7.1.min.js
/usr/local/nagios/share/includes/jquery-1.7.1.min.js
/usr/local/nagios/share/js/jquery-1.7.1.min.js
------
Once I click through the error on the webpage I also get this error:
Code: Select all
Whoops!
Error: Could not open CGI config file '/usr/local/nagios/etc/cgi.cfg' for reading!
Here are some things you should check in order to resolve this error:
Make sure you've installed a CGI config file in its proper location. See the error message about for details on where the CGI is expecting to find the configuration file. A sample CGI configuration file (named cgi.cfg) can be found in the sample-config/ subdirectory of the Nagios source code distribution.
Make sure the user your web server is running as has permission to read the CGI config file.
Make sure you read the documentation on installing and configuring Nagios thoroughly before continuing. If all else fails, try sending a message to one of the mailing lists. More information can be found at http://www.nagios.org.
One thing of note however is that cgi.cfg file is not located in /usr/local/nagios/etc/ it is actually located in /etc/nagios
Note: The current configuration is not by choice since I inherited this from someone else and the system was left to it's own devices and stopped working about 2 years ago because someone let the file system fill up.
Re: Error after upgrading from 3.2.3 to 3.5.1
Posted: Mon Oct 21, 2013 10:24 am
by tmcdonald
I've gone ahead and combined your three posts into one. We'd appreciate it if you did the same if you have multiple things in a row instead of making a new post for each.
Re: Error after upgrading from 3.2.3 to 3.5.1
Posted: Mon Oct 21, 2013 1:48 pm
by gtneon99
I have checked the nagios and nagcmd groups to make sure both nagios and apache are part of the groups:
nagios

30003:nagios,apache
nagcmd

30004:nagios,apache
Re: Error after upgrading from 3.2.3 to 3.5.1
Posted: Mon Oct 21, 2013 1:55 pm
by abrist
Couple questions:
1. How was nagios originally installed - source or repo?
2. How are you performing the upgrade - source or repo?
3. What linux distribution are you running on your nagios server?
Re: Error after upgrading from 3.2.3 to 3.5.1
Posted: Mon Oct 21, 2013 1:59 pm
by gtneon99
Not sure about the terminology. What is a source or repo?
Re: Error after upgrading from 3.2.3 to 3.5.1
Posted: Mon Oct 21, 2013 2:06 pm
by tmcdonald
Since this is an inherited system, he may not know how it was originally installed.
Can you run the following and post the output?
2. How are you performing the upgrade - source or repo?
What commands did you type to perform the upgrade?
3. What linux distribution are you running on your nagios server?
Are you running CentOS, RedHat, Ubuntu?
Re: Error after upgrading from 3.2.3 to 3.5.1
Posted: Mon Oct 21, 2013 2:07 pm
by abrist
source = compiled from source code
repo = acquired from your linux distribution's package repository
Re: Error after upgrading from 3.2.3 to 3.5.1
Posted: Mon Oct 21, 2013 2:11 pm
by gtneon99
abrist wrote:Couple questions:
1. How was nagios originally installed - source or repo?
Unknown. The guy left the company a few years ago.
abrist wrote:Couple questions:
2. How are you performing the upgrade - source or repo?
I installed the upgrade from what I think is source: wget
http://prdownloads.sourceforge.net/sour ... 5.1.tar.gz
abrist wrote:Couple questions:
3. What linux distribution are you running on your nagios server?
Red Hat Enterprise Linux Server release 5.7 (Tikanga)
Re: Error after upgrading from 3.2.3 to 3.5.1
Posted: Mon Oct 21, 2013 2:15 pm
by gtneon99
tmcdonald wrote:Can you run the following and post the output?
# ls -l /usr/local
total 108
drwxr-xr-x 2 root root 4096 Jan 11 2011 bin
drwxr-xr-x 2 root root 4096 Jan 11 2011 etc
drwxr-xr-x 2 root root 4096 Oct 1 2009 games
drwxr-xr-x 2 root root 4096 Oct 1 2009 include
drwxr-xr-x 2 root root 4096 Oct 1 2009 lib
drwxr-xr-x 2 root root 4096 Oct 1 2009 lib64
drwxr-xr-x 2 root root 4096 Oct 1 2009 libexec
drwx------ 2 root root 16384 Nov 11 2010 lost+found
drwxrwxr-x 8 root root 4096 Feb 28 2011 nagios
drwxr-xr-x 2 root root 4096 Jan 11 2011 perf
drwxr-xr-x 2 root root 4096 Oct 1 2009 sbin
drwxr-xr-x 4 root root 4096 Nov 11 2010 share
drwxr-xr-x 2 root root 4096 Oct 1 2009 src
tmcdonald wrote:2. How are you performing the upgrade - source or repo?
What commands did you type to perform the upgrade?
su -l nagios
cd /etc
wget
http://prdownloads.sourceforge.net/sour ... 5.1.tar.gz
tar -xzf nagios-3.5.1.tar.gz
cd nagios
./configure --with-command-group=nagcmd
make all
make install
/usr/local/nagios/bin/nagios -v /etc/nagios/nagios.cfg
/sbin/service nagios restart
tmcdonald wrote:3. What linux distribution are you running on your nagios server?
Are you running CentOS, RedHat, Ubuntu?
cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.7 (Tikanga)
Re: Error after upgrading from 3.2.3 to 3.5.1
Posted: Mon Oct 21, 2013 2:27 pm
by gtneon99
I checked the cgi.cfg to make sure that it wasn't an issue with my user_id accessing parts of the webpage:
Code: Select all
# grep authorized /etc/nagios/cgi.cfg
authorized_for_system_information=nagiosadmin,<user_id>
authorized_for_configuration_information=nagiosadmin,<user_id>
authorized_for_system_commands=nagiosadmin,<user_id>
authorized_for_all_services=nagiosadmin,<user_id>
authorized_for_all_hosts=nagiosadmin,<user_id>
authorized_for_all_service_commands=nagiosadmin,<user_id>
authorized_for_all_host_commands=nagiosadmin,<user_id>
Nagios is running:
Code: Select all
service nagios status
nagios (pid 17171) is running...
cgi authentication is configured:
Code: Select all
grep authentication /etc/nagios/cgi.cfg
use_authentication=1
This is the output I get when I tail the access_log for apache:
Code: Select all
<IP_Address> - <user_id> [21/Oct/2013:13:57:06 -0500] "GET /nagios/cgi-bin/jquery-1.7.1.min.js HTTP/1.1" 404 312 "http://<ip_address>/nagios/cgi-bin/status.cgi?hostgroup=all&style=hostdetail" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/6.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3; MS-RTC LM 8; .NET CLR 1.1.4322; .NET4.0C; .NET4.0E)"
This is what the nagios.conf file looks like:
Code: Select all
cat /etc/httpd/conf.d/nagios.conf
# SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER
# Last Modified: 11-26-2005
#
# 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
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /etc/nagios/htpasswd.users
Require valid-user
</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 Access"
AuthType Basic
AuthUserFile /etc/nagios/htpasswd.users
Require valid-user
</Directory>
Permissions on the CGI Files:
Code: Select all
[root@ctisecsysmon2 httpd]# ll /usr/local/nagios/sbin
total 3916
-rwxrwxr-x 1 nagios nagios 276576 Oct 21 12:17 avail.cgi
-rwxrwxr-x 1 nagios nagios 281136 Oct 21 12:17 cmd.cgi
-rwxrwxr-x 1 nagios nagios 247584 Oct 21 12:17 config.cgi
-rwxrwxr-x 1 nagios nagios 292672 Oct 21 12:17 extinfo.cgi
-rwxrwxr-x 1 nagios nagios 243712 Oct 21 12:17 histogram.cgi
-rwxrwxr-x 1 nagios nagios 223040 Oct 21 12:17 history.cgi
-rwxrwxr-x 1 nagios nagios 219008 Oct 21 12:17 notifications.cgi
-rwxrwxr-x 1 nagios nagios 214784 Oct 21 12:17 outages.cgi
-rwxrwxr-x 1 nagios nagios 219200 Oct 21 12:17 showlog.cgi
-rwxrwxr-x 1 nagios nagios 284896 Oct 21 12:17 status.cgi
-rwxrwxr-x 1 nagios nagios 239712 Oct 21 12:17 statusmap.cgi
-rwxrwxr-x 1 nagios nagios 232448 Oct 21 12:17 statuswml.cgi
-rwxrwxr-x 1 nagios nagios 218944 Oct 21 12:17 statuswrl.cgi
-rwxrwxr-x 1 nagios nagios 239584 Oct 21 12:17 summary.cgi
-rwxrwxr-x 1 nagios nagios 231264 Oct 21 12:17 tac.cgi
-rwxrwxr-x 1 nagios nagios 247840 Oct 21 12:17 trends.cgi
[root@ctisecsysmon2 httpd]# ll /usr/local/nagios/share
total 72
-rw-rw-r-- 1 nagios nagios 576 Oct 21 12:17 config.inc.php
drwxrwxr-x 2 nagios nagios 4096 Oct 21 12:17 contexthelp
drwxrwxr-x 3 nagios nagios 4096 Feb 28 2011 docs
drwxrwxr-x 3 nagios nagios 4096 Oct 21 12:17 images
drwxrwxr-x 3 nagios nagios 4096 Oct 21 12:17 includes
-rw-rw-r-- 1 nagios nagios 1608 Oct 21 12:17 index.php
drwxrwxr-x 2 nagios nagios 4096 Oct 21 12:17 js
drwxrwxr-x 4 nagios nagios 4096 Feb 28 2011 locale
-rw-rw-r-- 1 nagios nagios 5863 Oct 21 12:17 main.php
drwxrwxr-x 2 nagios nagios 4096 Feb 28 2011 media
-rw-rw-r-- 1 nagios nagios 26 Oct 21 12:17 robots.txt
-rw-rw-r-- 1 nagios nagios 941 Oct 21 12:17 rss-corefeed.php
-rw-rw-r-- 1 nagios nagios 995 Oct 21 12:17 rss-newsfeed.php
-rw-rw-r-- 1 nagios nagios 5756 Oct 21 12:17 side.php
drwxrwxr-x 2 nagios nagios 4096 Feb 28 2011 ssi
drwxrwxr-x 2 nagios nagios 4096 Oct 21 12:17 stylesheets