Nagvis PHP error

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
hillhealthcenter
Posts: 174
Joined: Fri Sep 21, 2012 7:45 am
Location: New Haven, CT

Nagvis PHP error

Post by hillhealthcenter »

I get this error when I click the Default Automap button in Nagvis:

PHP error in ajax request handler: Error: (2) fopen(/usr/local/nagvis/var/__automap.dot): failed to open stream: Permission denied

I'm not sure where to begin troubleshooting. Should I reconfigure Nagvis?

Thanks,
Tom
Thanks so much,
Tom
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagvis PHP error

Post by abrist »

Could you try to access the page once again and then post a large tail of the apache log?

Code: Select all

tail -30 /var/log/httpd/error_log
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
hillhealthcenter
Posts: 174
Joined: Fri Sep 21, 2012 7:45 am
Location: New Haven, CT

Re: Nagvis PHP error

Post by hillhealthcenter »

[codelogin as: root
[email protected]'s password:
Last login: Wed Apr 23 17:19:17 2014 from 22hsmk1.hhc.com
[root@nagiosxi ~]# [root@nagiosxi ~]# tail -30 /var/log/httpd/error_log -bash: [root@nagiosxi: command not found
[root@nagiosxi ~]# tail -30 /var/log/httpd/error_log
[Wed Apr 23 17:22:28 2014] [error] [client 192.168.102.81] PHP Warning: fopen(/usr/local/nagvis/var/__automap.dot): failed to open stream: Permission denied in /usr/local/nagvis/share/server/core/classes/NagVisAutoMap.php on line 340, referer: http://192.168.100.230/nagvis/frontend/nagvis-js/
[Wed Apr 23 17:22:28 2014] [error] [client 192.168.102.81] PHP Warning: fwrite() expects parameter 1 to be resource, boolean given in /usr/local/nagvis/share/server/core/classes/NagVisAutoMap.php on line 341, referer: http://192.168.100.230/nagvis/frontend/nagvis-js/
[Wed Apr 23 17:22:28 2014] [error] [client 192.168.102.81] PHP Warning: fclose() expects parameter 1 to be resource, boolean given in /usr/local/nagvis/share/server/core/classes/NagVisAutoMap.php on line 342, referer: http://192.168.100.230/nagvis/frontend/nagvis-js/
[Wed Apr 23 17:25:02 2014] [error] [client 192.168.102.81] PHP Warning: fopen(/usr/local/nagvis/var/__automap.dot): failed to open stream: Permission denied in /usr/local/nagvis/share/server/core/classes/NagVisAutoMap.php on line 340, referer: http://192.168.100.230/nagvis/frontend/nagvis-js/
[Wed Apr 23 17:25:02 2014] [error] [client 192.168.102.81] PHP Warning: fwrite() expects parameter 1 to be resource, boolean given in /usr/local/nagvis/share/server/core/classes/NagVisAutoMap.php on line 341, referer: http://192.168.100.230/nagvis/frontend/nagvis-js/
[Wed Apr 23 17:25:02 2014] [error] [client 192.168.102.81] PHP Warning: fclose() expects parameter 1 to be resource, boolean given in /usr/local/nagvis/share/server/core/classes/NagVisAutoMap.php on line 342, referer: http://192.168.100.230/nagvis/frontend/nagvis-js/
[root@nagiosxi ~]#
][/code]
Thanks so much,
Tom
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagvis PHP error

Post by abrist »

Have you upgraded nagvis? (don't upgrade as newer versions of nagvis than what shipped with XI will cause issues)
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
hillhealthcenter
Posts: 174
Joined: Fri Sep 21, 2012 7:45 am
Location: New Haven, CT

Re: Nagvis PHP error

Post by hillhealthcenter »

Andy,

Thanks for getting back to me.

My colleague may have attempted to upgrade Nagvis. The installed version is NagVis Version 1.5.9

Is this the proper version? How can I get this sorted?

Thanks,
Tom
Thanks so much,
Tom
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Nagvis PHP error

Post by slansing »

1.5.9 is correct, what is the output of the following:

Code: Select all

ls -la /usr/local/nagvis/var/
Is it only automap that causes this? What about the other maps?
hillhealthcenter
Posts: 174
Joined: Fri Sep 21, 2012 7:45 am
Location: New Haven, CT

Re: Nagvis PHP error

Post by hillhealthcenter »

Code: Select all

login as: root
[email protected]'s password:
Last login: Wed Apr 23 17:24:50 2014 from 22hsmk1.hhc.com
[root@nagiosxi ~]# ls -la /usr/local/nagvis/var/
total 140
drwxrwxr-x 3    775 apache  4096 Apr  7 17:27 .
drwxr-xr-x 5 apache apache  4096 Apr 22 16:40 ..
-rw-r--r-- 1    664 apache   466 Apr  7 11:49 __automap.cfg-1.5.9-cache
-rw-r--r-- 1    664 apache  7001 Apr  7 11:49 __automap.cfg-1.5.9-cache-defs
-rw-r--r-- 1    664 apache 20454 Apr 22 15:12 __automap.dot
-rw-r--r-- 1    664 apache   805 Apr  7 17:27 context-default-de_DE.cache
-rw-r--r-- 1    664 apache   767 Apr  7 11:50 context-default-en_US.cache
-rw-r--r-- 1    664 apache   771 Apr  7 11:50 demo2.cfg-1.5.9-cache
-rw-r--r-- 1    664 apache  6982 Apr  7 11:50 demo2.cfg-1.5.9-cache-defs
-rw-r--r-- 1    664 apache  1246 Apr  7 11:50 demo.cfg-1.5.9-cache
-rw-r--r-- 1    664 apache  6981 Apr  7 11:50 demo.cfg-1.5.9-cache-defs
-rw-r--r-- 1    664 apache  1061 Apr  7 11:50 demo-map.cfg-1.5.9-cache
-rw-r--r-- 1    664 apache  6985 Apr  7 11:50 demo-map.cfg-1.5.9-cache-defs
-rw-r--r-- 1    664 apache  1828 Apr  7 11:50 demo-server.cfg-1.5.9-cache
-rw-r--r-- 1    664 apache  6989 Apr  7 11:50 demo-server.cfg-1.5.9-cache-defs
-rw-r--r-- 1    664 apache  2985 Apr  7 17:27 hover-default-de_DE.cache
-rw-r--r-- 1    664 apache  2916 Apr  7 11:50 hover-default-en_US.cache
-rw-r--r-- 1    664 apache   836 Apr 22 15:03 nagvis-audit.log
-rw-r--r-- 1    664 apache 26842 Apr  7 11:49 nagvis.ini.php-1.5.9-cache
drwxrwxr-x 4    664 apache  4096 Apr  7 11:49 tmpl
[root@nagiosxi ~]#
The demo maps are fine. There are no other maps.
Thanks so much,
Tom
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Nagvis PHP error

Post by lmiltchev »

What is the NagVis version that is shown when you go to: Home->Nagvis->Need Help->NagVis Support Information? Can you show us a screenshot of this page?
Be sure to check out our Knowledgebase for helpful articles and solutions!
hillhealthcenter
Posts: 174
Joined: Fri Sep 21, 2012 7:45 am
Location: New Haven, CT

Re: Nagvis PHP error

Post by hillhealthcenter »

See attached
You do not have the required permissions to view the files attached to this post.
Thanks so much,
Tom
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Nagvis PHP error

Post by slansing »

Though your other maps work fine, only the automap requires the '.dot' file. Lets try changing it's user to the actual user name not the UID:

Code: Select all

chown apache /usr/local/nagvis/var/__automap.dot
It does not seem like apache is throwing fatal errors out in it's log, so that is a good sign. If this does not work, can you post your access log too?:

Code: Select all

tail -30 /var/log/httpd/access_log
Locked