Page 1 of 1
Nagvis-ajax error
Posted: Mon Oct 24, 2016 5:01 pm
by maartin.pii
Hi Guys,
I have the following scenario:
Server: VM - VMware
OS: CentOS7 Nagios XI - Latest update
Error description:
Every time I acces nagvis (doesn't matter if I accces from NagiosXI interface or through ip/nagvis) I get the following error: PHP error in ajx request handler: Error(8) Array to String conversion (path/nagvis/share/server/core/ajax_handler.php:164)
Steps to reproduce:
1) Login Nagios XI
2) Access NagVis
Note: Once I press the (x) on the error I can access NagVis without any issue. However, I need to resolve this since users may not understand what is happening.
Regards,
Re: Nagvis-ajax error
Posted: Mon Oct 24, 2016 5:30 pm
by maartin.pii
SS attach
Re: Nagvis-ajax error
Posted: Tue Oct 25, 2016 10:31 am
by rkennedy
Could you post the handler file for us to look at? On my system, it's /usr/local/nagvis/share/server/core/ajax_handler.php. The file is only 143 lines on my end, so just looking for clarification here as your PHP error appears on line 164.
Also, could you post the screenshot once again? It doesn't look like it attached the first time.
Re: Nagvis-ajax error
Posted: Tue Oct 25, 2016 11:08 am
by maartin.pii
Hi rkeneddy - I will upload them.
The line 164 has the following:
if($MODULE !== false && $MODULE->offersAction($UHANDLER->get('act'))) {
$MODULE->setAction($UHANDLER->get('act'));
// Handle the given action in the module
$sContent = $MODULE->handleAction();
} else {
throw new NagVisException($CORE->getLang()->getText('The given action is not valid'));
}
} catch(NagVisException $e) {
new GlobalMessage('ERROR', $e->getMessage());
}
164: echo $sContent;
I might thing that if it's an array it should be called in another way... However, it's just an impression.
I will upload the files.
Regards,
Re: Nagvis-ajax error
Posted: Tue Oct 25, 2016 4:18 pm
by dwhitfield
What version of NagVis are you using? Unfortunately, that ajax_handler file doesn't give us a version #.
Re: Nagvis-ajax error
Posted: Wed Oct 26, 2016 1:04 pm
by maartin.pii
dwhitfield wrote:What version of NagVis are you using? Unfortunately, that ajax_handler file doesn't give us a version #.
This is the NagVis version that comes with the Latest NagiosXI version. I think that on the /usr/local/nagvis/README it says that it is the NagVis version 1.5 //Which is a really old version of the product.
Regards,
Re: Nagvis-ajax error
Posted: Wed Oct 26, 2016 3:27 pm
by dwhitfield
Can you comment out if (DEBUG&&DEBUGLEVEL&4) debugFinalize(); with //
I did that on mine and it still seems to be working. I'm not getting the error you are getting, but at least it didn't seem to cause any issue. Since you aren't seeing any issue, I don't want to cause any new ones, but getting rid of the debug seems harmless.
You shouldn't need to restart the httpd service, but if commenting that line doesn't fix it initially, go ahead and restart apache.
If that doesn't work, we are prepping 5.3.2 for release. Running the upgrade might just clear whatever you have going on.
Re: Nagvis-ajax error
Posted: Fri Oct 28, 2016 8:57 am
by maartin.pii
Hi dwhitfield - I've already tried that before opening the case and it didn't work. However, I did not try to restart the apache service but I don't think that will work unless it has a temp cache dir or something like that.
I will try that and let you know.
Regards,
dwhitfield wrote:Can you comment out if (DEBUG&&DEBUGLEVEL&4) debugFinalize(); with //
I did that on mine and it still seems to be working. I'm not getting the error you are getting, but at least it didn't seem to cause any issue. Since you aren't seeing any issue, I don't want to cause any new ones, but getting rid of the debug seems harmless.
You shouldn't need to restart the httpd service, but if commenting that line doesn't fix it initially, go ahead and restart apache.
If that doesn't work, we are prepping 5.3.2 for release. Running the upgrade might just clear whatever you have going on.
Re: Nagvis-ajax error
Posted: Fri Oct 28, 2016 9:25 am
by dwhitfield
Let us know how the service restart goes. Like I said, 5.3.2 is just around the corner: week after next at the latest.