Nagvis-ajax error

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
maartin.pii
Posts: 84
Joined: Wed May 18, 2016 1:39 pm

Nagvis-ajax error

Post 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,
maartin.pii
Posts: 84
Joined: Wed May 18, 2016 1:39 pm

Re: Nagvis-ajax error

Post by maartin.pii »

SS attach
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Nagvis-ajax error

Post 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.
Former Nagios Employee
maartin.pii
Posts: 84
Joined: Wed May 18, 2016 1:39 pm

Re: Nagvis-ajax error

Post 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,
You do not have the required permissions to view the files attached to this post.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Nagvis-ajax error

Post by dwhitfield »

What version of NagVis are you using? Unfortunately, that ajax_handler file doesn't give us a version #.
maartin.pii
Posts: 84
Joined: Wed May 18, 2016 1:39 pm

Re: Nagvis-ajax error

Post 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,
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Nagvis-ajax error

Post 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.
maartin.pii
Posts: 84
Joined: Wed May 18, 2016 1:39 pm

Re: Nagvis-ajax error

Post 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.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Nagvis-ajax error

Post 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.
Locked