Page 1 of 15
Nagios 4.1.1 Statusmap problem
Posted: Fri Aug 21, 2015 3:43 am
by whitest
Hi everyone. Today I tried to upgrade my Nagios Core 4.0.8 to latest 4.1.1.
New version installed successfully, but New Map doesn't work (empty frame). When I click the link "View Status Detail For This Host" the browser (firefox and IE11) tries to open/save file status.cgi
Legacy map works fine.
My enviroment is:
-OS Centos 5.10 (Final) kernel 2.6.18-400.el5
- Apache: 2.2.3-83
- PHP: PHP 5.1.6 (cli)
Code: Select all
# rpm -qa | grep php
php-xml-5.1.6-45.el5_11
php-pdo-5.1.6-45.el5_11
php-gd-5.1.6-45.el5_11
php-rrdtool-1.4.4-1.el5.rf
phpmyadmin-2.11.11.3-2.el5.rf
php-common-5.1.6-45.el5_11
php-mysql-5.1.6-45.el5_11
php-soap-5.1.6-45.el5_11
php-mcrypt-5.1.6-15.el5.centos.1
php-5.1.6-45.el5_11
php-mbstring-5.1.6-45.el5_11
php-pear-1.4.9-8.el5
php-cli-5.1.6-45.el5_11
php-devel-5.1.6-45.el5_11
php-odbc-5.1.6-45.el5_11
In my httpd.conf configured:
Code: Select all
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
<Directory "/var/www/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
With this configuration (above) map in 4.0.8 worked fine. But in 4.1.1 with this config I recived errors in error.log:
Code: Select all
[Fri Aug 21 11:30:05 2015] [error] [client 10.14.2.220] script not found or unable to stat: /var/www/cgi-bin/statusjson.cgi, referer: http://nagios.domain.by/map.html?host=all
[Fri Aug 21 11:30:05 2015] [error] [client 10.14.2.220] script not found or unable to stat: /var/www/cgi-bin/objectjson.cgi, referer: http://nagios.domain.by/map.html?host=all
I tried to copy statusjson.cgi and objectjson.cgi from /usr/local/nagios/sbin, but without luck.
In my
/etc/httpd/conf/httpd.conf I re-configured ScriptAlias as mentioned below:
Code: Select all
ScriptAlias /cgi-bin "/usr/local/nagios/sbin"
<Directory "/usr/local/nagios/sbin">
AllowOverride None
Options ExecCGI
Options None
Order allow,deny
Allow from all
</Directory>
In the
/etc/httpd/conf.d/nagios.conf I have:
Code: Select all
<AuthnProviderAlias ldap domain>
AuthLDAPURL "ldap://corp.domain.by:3268/ou=BNB,dc=corp,dc=domain,dc=by?sAMAccountName?sub?(objectClass=user)" NONE
AuthLDAPBindDN [email protected]
AuthLDAPBindPassword password
</AuthnProviderAlias>
<VirtualHost *:80>
DocumentRoot /usr/local/nagios/share
ServerName nagios.domain.by
</VirtualHost>
ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"
<Directory "/usr/local/nagios/sbin">
# SSLRequireSSL
Options ExecCGI
AllowOverride None
<IfVersion >= 2.3>
<RequireAll>
Require all granted
# Require host 127.0.0.1
AuthType Basic
AuthzLDAPAuthoritative off
AuthBasicProvider domain
AuthName "Nagios LDAP Authentication"
require valid-user
</RequireAll>
</IfVersion>
<IfVersion < 2.3>
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
AuthType Basic
AuthzLDAPAuthoritative off
AuthBasicProvider domain
AuthName "Nagios LDAP Authentication"
require valid-user
</IfVersion>
</Directory>
Alias /nagios "/usr/local/nagios/share"
<Directory "/usr/local/nagios/share">
# SSLRequireSSL
Options None
AllowOverride None
<IfVersion >= 2.3>
<RequireAll>
Require all granted
# Require host 127.0.0.1
AuthType Basic
AuthzLDAPAuthoritative off
AuthBasicProvider domain
AuthName "Nagios LDAP Authentication"
require valid-user
</RequireAll>
</IfVersion>
<IfVersion < 2.3>
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
AuthType Basic
AuthzLDAPAuthoritative off
AuthBasicProvider domain
AuthName "Nagios LDAP Authentication"
require valid-user
</IfVersion>
</Directory>
In this configuration error.log is silent, but New Map doesn't work =(
I tried to disable my virtual hosting, execute
make install-webconf and access GUI through IP address (
http://10.1.1.2/nagios), but map map doesn't work again((
Can somebody help me?
Re: Nagios 4.1.1 Statusmap problem
Posted: Fri Aug 21, 2015 2:11 pm
by jolson
One thing of note is that my php versions are more recent than yours:
php-common-5.3.3-46.el6_6.x86_64
php-cli-5.3.3-46.el6_6.x86_64
php-5.3.3-46.el6_6.x86_64
Additional version information:
Code: Select all
[root@localhost sbin]# apachectl -v
Server version: Apache/2.2.15 (Unix)
Server built: Jul 24 2015 11:52:28
Code: Select all
[root@localhost sbin]# cat /etc/*release*
CentOS release 6.6 (Final)
CentOS release 6.6 (Final)
CentOS release 6.6 (Final)
cpe:/o:centos:linux:6:GA
Code: Select all
[root@localhost sbin]# uname -a
Linux localhost.localdomain 2.6.32-504.el6.x86_64 #1 SMP Wed Oct 15 04:27:16 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
I installed from source, and I don't have the problem that you're describing. My history is as follows:
Code: Select all
[root@localhost tmp]# history
sestatus
vi /etc/sysconfig/selinux
reboot (disabled SELinux)
yum install -y wget httpd php gcc glibc glibc-common gd gd-devel make net-snmp unzip automake
cd /tmp
wget https://github.com/NagiosEnterprises/nagioscore/archive/master.tar.gz -O nagioscore.tar.gz
wget https://github.com/nagios-plugins/nagios-plugins/archive/master.tar.gz -O nagiosplugins.tar.gz
useradd nagios
groupadd nagcmd
usermod -a -G nagcmd nagios
usermod -a -G nagcmd apache
tar xzf nagioscore.tar.gz
tar xzf nagiosplugins.tar.gz
cd nagioscore-master
./configure --with-command-group=nagcmd
make all
make install
make install-init
make install-config
make install-commandmode
make install-webconf
cp -R contrib/eventhandlers /usr/local/nagios/libexec
chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
/etc/init.d/nagios start
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
/etc/init.d/httpd start
cd /tmp/nagios-plugins-master/
./tools/setup
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make install
cd /usr/local/nagios/libexec/
ls
./check_http -H google.com
cd /tmp
chkconfig --add nagios
chkconfig --level 35 nagios on
chkconfig --add httpd
chkconfig --level 35 httpd on
ip a
service iptables stop
rpm -qa | grep php
history
Is it possible for you to stand up a new Core box and move your configurations over to it? It's possible that troubleshooting your problem could take more time than standing up a new box and following the above instructions.
I tried to copy statusjson.cgi and objectjson.cgi from /usr/local/nagios/sbin, but without luck.
When you copied those files, did you set the permissions appropriately?
[root@localhost sbin]# ls -l | egrep "object|statusjs"
-rwxrwxr-x 1 nagios nagios 312512 Aug 21 09:00 objectjson.cgi
-rwxrwxr-x 1 nagios nagios 306560 Aug 21 09:00 statusjson.cgi
My nagios.conf for reference:
Code: Select all
[root@localhost sbin]# cat /etc/httpd/conf.d/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.3>
<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.3>
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.3>
<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.3>
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>
Re: Nagios 4.1.1 Statusmap problem
Posted: Fri Aug 21, 2015 3:07 pm
by whitest
jolson, thank you for reply.
I belive if I instal nagios 4.1.1 on the vergin system everithing would work fine. But erlier I upgrated Nagios many times from 3.x to 4.x and so on and didn't have these problems.
I support many nagios instalations and it would hard to move nagioses from centos 5 to 6..
I belive that problem in wrong code in map*.html. May be somebode have other solutions?
Tomorrow I''ll try to upgrade php to php5.3.
Re: Nagios 4.1.1 Statusmap problem
Posted: Sat Aug 22, 2015 12:46 am
by whitest
I upgraded php to php 5.3, but still no progress (new map is not working, error.log is in silence) :
Code: Select all
# php -v
PHP 5.3.3 (cli) (built: Oct 31 2014 09:53:00)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
I did upgrade through yum shell:
Code: Select all
# yum shell
> remove php php-pear php-cli php-devel php-xml php-pdo php-gd php-rrdtool php-common php-mysql php-soap php-mcrypt php-mbstring php-odbc
> install php53 php53-pear php53-cli php53-devel php53-xml php53-pdo php53-gd php53-rrdtool php53-common php53-mysql php53-soap php53-mcrypt php53-mbstring php53-odbc
> run
When you copied those files, did you set the permissions appropriately?
Yes, permissions to these files and folder cgi-bin was fine.
Re: Nagios 4.1.1 Statusmap problem
Posted: Mon Aug 24, 2015 7:26 am
by szosszenet
Same here.
So this is a permission issue.
If you have a look into /usr/local/nagios/etc/cgi.cfg, modify use_authentication=1 to use_authentication=0 TEMPORARILY it should work.
For some reason the * wildcard does not work...
PS: also check contents of /var/www/cgi-bin/ you might need to copy the cgis from /usr/local/nagios/sbin/
Re: Nagios 4.1.1 Statusmap problem
Posted: Mon Aug 24, 2015 9:06 am
by whitest
Thank you for your responce, szosszenet.
I tried your advices, but without luck((
I checked permissions and disabled auth.
Httpd and Nagios have been restarted.
There are no messages in error.log
=(((
Re: Nagios 4.1.1 Statusmap problem
Posted: Mon Aug 24, 2015 10:39 am
by szosszenet
Copied the files too if were not present?

Re: Nagios 4.1.1 Statusmap problem
Posted: Mon Aug 24, 2015 10:52 am
by whitest
Yes, I copied all files:
Code: Select all
[b][root@nagios ~]# ls -la /var/www/cgi-bin/[/b]
total 6348
drwxr-xr-x 2 nagios nagios 4096 Aug 24 16:57 .
drwxr-xr-x 6 root root 4096 Dec 13 2013 ..
-rwxr-xr-x 1 nagios nagios 33073 Aug 24 16:57 14all.cgi
-rw-r--r-- 1 nagios nagios 39 Aug 24 16:57 --adminsnumbers.txt
-rwxr-xr-x 1 nagios nagios 284256 Aug 24 16:57 archivejson.cgi
-rwxr-xr-x 1 nagios nagios 280512 Aug 24 16:57 avail.cgi
-rwxr-xr-x 1 nagios nagios 96021 Aug 24 16:57 class.phpmailer.php
-rwxr-xr-x 1 nagios nagios 33155 Aug 24 16:57 class.smtp.php
-rwxr-xr-x 1 nagios nagios 278992 Aug 24 16:57 cmd.cgi
-rwxr-xr-x 1 nagios nagios 254880 Aug 24 16:57 config.cgi
-rw-r--r-- 1 nagios nagios 3 Aug 24 16:57 count-electro.txt~
-rwxr-xr-x 1 nagios nagios 3 Aug 24 16:57 count.txt
-rw-r--r-- 1 nagios nagios 2 Aug 24 16:57 count.txt~
-rw-r--r-- 1 nagios nagios 26 Aug 24 16:57 --electronumbers.txt
-rwxr-xr-x 1 nagios nagios 299936 Aug 24 16:57 extinfo.cgi
-rwxr-xr-x 1 nagios nagios 250944 Aug 24 16:57 histogram.cgi
-rwxr-xr-x 1 nagios nagios 230336 Aug 24 16:57 history.cgi
-rwxr-xr-x 1 nagios nagios 177 Aug 24 16:57 imb-rts-request.sh
-rw-r--r-- 1 nagios nagios 153 Aug 24 16:57 imb-rts-request.sh~
-rwxr-xr-x 1 nagios nagios 3328 Aug 24 16:57 mail_nagios_host
-rwxr-xr-x 1 nagios nagios 3518 Aug 24 16:57 mail_nagios_service
-rwxr-xr-x 1 nagios nagios 226336 Aug 24 16:57 notifications.cgi
-rwxr-xr-x 1 nagios nagios 288180 Aug 24 16:57 objectjson.cgi
-rwxr-xr-x 1 nagios nagios 222112 Aug 24 16:57 outages.cgi
-rw-r--r-- 1 nagios nagios 1815 Aug 24 16:57 rts-response.txt
-rwxr-xr-x 1 nagios nagios 22700 Aug 24 16:57 search.cgi
-rwxr-xr-x 1 nagios nagios 5348 Aug 24 16:57 show.cgi
-rw-r--r-- 1 nagios nagios 5352 Aug 24 16:57 show.cgi~
-rwxr-xr-x 1 nagios nagios 12051 Aug 24 16:57 showconfig.cgi
-rwxr-xr-x 1 nagios nagios 5302 Aug 24 16:57 showgraph.cgi
-rwxr-xr-x 1 nagios nagios 5276 Aug 24 16:57 showgroup.cgi
-rwxr-xr-x 1 nagios nagios 5487 Aug 24 16:57 showhost.cgi
-rwxr-xr-x 1 nagios nagios 226496 Aug 24 16:57 showlog.cgi
-rwxr-xr-x 1 nagios nagios 5092 Aug 24 16:57 showservice.cgi
-rwxr-xr-x 1 nagios nagios 387 Aug 24 16:57 --sms-electro.sh
-rw-r--r-- 1 nagios nagios 366 Aug 24 16:57 sms-electro.sh~
-rwxr-xr-x 1 nagios nagios 1116 Aug 24 16:57 sms-portech.sh
-rw-r--r-- 1 nagios nagios 996 Aug 24 16:57 sms-portech.sh~
-rwxr-xr-x 1 nagios nagios 371 Aug 24 16:57 --sms.sh
-rw-r--r-- 1 nagios nagios 392 Aug 24 16:57 sms.sh~
-rwxr-xr-x 1 nagios nagios 1533 Aug 24 16:57 sms-xml-sous.php
-rwxr-xr-x 1 nagios nagios 292800 Aug 24 16:57 status.cgi
-rwxr-xr-x 1 nagios nagios 276276 Aug 24 16:57 status (copy).cgi
-rwxr-xr-x 1 nagios nagios 284756 Aug 24 16:57 statusjson.cgi
-rwxr-xr-x 1 nagios nagios 246880 Aug 24 16:57 statusmap.cgi
-rwxr-xr-x 1 nagios nagios 609814 Aug 24 16:57 statusmap (mod).cgi
-rwxr-xr-x 1 nagios nagios 230232 Aug 24 16:57 statusmap_orig.cgi
-rwxr-xr-x 1 nagios nagios 239040 Aug 24 16:57 statuswml.cgi
-rwxr-xr-x 1 nagios nagios 226240 Aug 24 16:57 statuswrl.cgi
-rwxr-xr-x 1 nagios nagios 246752 Aug 24 16:57 summary.cgi
-rwxr-xr-x 1 nagios nagios 238592 Aug 24 16:57 tac.cgi
-rwxr-xr-x 1 nagios nagios 5483 Aug 24 16:57 testcolor.cgi
-rwxr-xr-x 1 nagios nagios 3870 Aug 24 16:57 testmail
-rwxr-xr-x 1 nagios nagios 255040 Aug 24 16:57 trends.cgi
[b][root@nagios ~]# ls -la /usr/local/nagios/sbin/[/b]
total 6340
drwxrwxr-x 2 nagios nagios 4096 Aug 21 10:50 .
drwxrwsr-x 11 nagios nagios 4096 Aug 21 09:28 ..
-rwxr-xr-x 1 root root 33073 Aug 21 10:50 14all.cgi
-rw-r--r-- 1 nagios nagios 39 Jun 4 2013 --adminsnumbers.txt
-rwxrwxr-x 1 nagios nagios 284256 Aug 21 09:34 archivejson.cgi
-rwxrwxr-x 1 nagios nagios 280512 Aug 21 09:34 avail.cgi
-rwxr-xr-x 1 nagios nagios 96021 Feb 2 2014 class.phpmailer.php
-rwxr-xr-x 1 nagios nagios 33155 Jun 10 2013 class.smtp.php
-rwxrwxr-x 1 nagios nagios 278992 Aug 21 09:34 cmd.cgi
-rwxrwxr-x 1 nagios nagios 254880 Aug 21 09:34 config.cgi
-rw-rw-rw- 1 nagios nagios 3 Apr 14 2012 count-electro.txt~
-rwxrwxrwx 1 nagios nagios 3 Aug 8 2014 count.txt
-rw-rw-rw- 1 nagios nagios 2 Apr 6 2012 count.txt~
-rw-r--r-- 1 nagios nagios 26 Aug 23 2012 --electronumbers.txt
-rwxrwxr-x 1 nagios nagios 299936 Aug 21 09:34 extinfo.cgi
-rwxrwxr-x 1 nagios nagios 250944 Aug 21 09:34 histogram.cgi
-rwxrwxr-x 1 nagios nagios 230336 Aug 21 09:34 history.cgi
-rwxr-xr-x 1 nagios nagios 177 Jan 3 2013 imb-rts-request.sh
-rw-r--r-- 1 nagios nagios 153 Jan 3 2013 imb-rts-request.sh~
-rwxr-xr-x 1 nagios nagios 3328 Jun 24 17:55 mail_nagios_host
-rwxr-xr-x 1 nagios nagios 3518 Jun 24 17:55 mail_nagios_service
-rwxrwxr-x 1 nagios nagios 226336 Aug 21 09:34 notifications.cgi
-rwxrwxr-x 1 nagios nagios 288180 Aug 21 09:34 objectjson.cgi
-rwxrwxr-x 1 nagios nagios 222112 Aug 21 09:34 outages.cgi
-rw-r--r-- 1 nagios nagios 1815 Jan 4 2013 rts-response.txt
-rwxr-xr-x 1 nagios nagios 22700 Jun 26 16:57 search.cgi
-rwxr-xr-x 1 nagios nagios 5348 Sep 4 2011 show.cgi
-rw-r--r-- 1 nagios nagios 5352 Jan 14 2011 show.cgi~
-rwxr-xr-x 1 nagios nagios 12051 Sep 4 2011 showconfig.cgi
-rwxr-xr-x 1 nagios nagios 5302 Sep 4 2011 showgraph.cgi
-rwxr-xr-x 1 nagios nagios 5276 Sep 4 2011 showgroup.cgi
-rwxr-xr-x 1 nagios nagios 5487 Sep 4 2011 showhost.cgi
-rwxrwxr-x 1 nagios nagios 226496 Aug 21 09:34 showlog.cgi
-rwxr-xr-x 1 nagios nagios 5092 Sep 4 2011 showservice.cgi
-rwxr-xrwx 1 nagios nagios 387 Aug 23 2012 --sms-electro.sh
-rw-r--rw- 1 nagios nagios 366 Aug 6 2012 sms-electro.sh~
-rwxr-xr-x 1 nagios nagios 1116 Dec 30 2014 sms-portech.sh
-rw-r--r-- 1 nagios nagios 996 Jun 27 2012 sms-portech.sh~
-rwxr-xrwx 1 nagios nagios 371 Jun 4 2013 --sms.sh
-rw-r--rw- 1 nagios nagios 392 Feb 28 2013 sms.sh~
-rwxr-xr-x 1 nagios nagios 1533 Jun 27 10:24 sms-xml-sous.php
-rwxrwxr-x 1 nagios nagios 292800 Aug 21 09:34 status.cgi
-rwxrwxr-x 1 nagios nagios 276276 Feb 9 2013 status (copy).cgi
-rwxrwxr-x 1 nagios nagios 284756 Aug 21 09:34 statusjson.cgi
-rwxrwxr-x 1 nagios nagios 246880 Aug 21 09:34 statusmap.cgi
-rwxr-xr-x 1 nagios nagios 609814 Feb 10 2013 statusmap (mod).cgi
-rwxrwxr-x 1 nagios nagios 230232 Feb 10 2013 statusmap_orig.cgi
-rwxrwxr-x 1 nagios nagios 239040 Aug 21 09:34 statuswml.cgi
-rwxrwxr-x 1 nagios nagios 226240 Aug 21 09:34 statuswrl.cgi
-rwxrwxr-x 1 nagios nagios 246752 Aug 21 09:34 summary.cgi
-rwxrwxr-x 1 nagios nagios 238592 Aug 21 09:34 tac.cgi
-rwxr-xr-x 1 nagios nagios 5483 Sep 4 2011 testcolor.cgi
-rwxr-xr-x 1 nagios nagios 3870 Jun 23 15:44 testmail
-rwxrwxr-x 1 nagios nagios 255040 Aug 21 09:34 trends.cgi
[root@nagios ~]#
Re: Nagios 4.1.1 Statusmap problem
Posted: Mon Aug 24, 2015 11:00 am
by whitest
Ooops, I just tried to open new map in IE11 again and it opened. In Mozilla 34 still doesn't work, but it is not nagios trouble.
Now I'll try to upgrade flash for Firefox. Thank you!
Whatever, I think there is samething wrong in Nagios 4.1.1. Previews versions didn't have these problems (copy cgi to other folder no needed).
Re: Nagios 4.1.1 Statusmap problem
Posted: Mon Aug 24, 2015 11:27 am
by whitest
I upgradet flash for all my browsers (IE,FF,GH,Opera). New Map works only in IE11. My PC with Windows 8.
On the other PC with Windows XP SP3 I upgradet flashplayer and tried in 4 browsers. Not working in all =|