Page 1 of 2

Graph not showing

Posted: Tue Mar 23, 2021 3:00 am
by nagmites
Hi there!

I have successfully integrated nna with nagios xi, but in the host tab, Network traffic analysis, the graph is not shown, showing me the browser developer mode, the following error:

Access to XMLHttpRequest from origin has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Can someone help me fix it?
Attachment screenshot

Thank you a lot
Regards

Re: Graph not showing

Posted: Tue Mar 23, 2021 5:37 pm
by benjaminsmith
Hi nagmites,

I ran a test of this on my systems here without error. What version of Nagios XI and Network Analyzer are you using?

Also, have you made any changes to the Apache configuration files on either system? Are you using any proxies?

Thanks,
Benajmin

Re: Graph not showing

Posted: Wed Mar 24, 2021 3:46 am
by nagmites
Hi!

I have tried with two environments:

NNA 2.4.1 Nagios 5.4.13
NNA 2.4.1 Nagios 5.7.5

In both the same problem.

Nothing in apache has been modified and no proxy is configured.

Regards

Re: Graph not showing

Posted: Wed Mar 24, 2021 3:19 pm
by benjaminsmith
Hi @nagmites,

So after further review, we think this is an SSL issue. Do you have SSL enabled on Nagios XI as well? If one system is using SSL and the other system is not, Chrome will trigger this type of error.

Also, try adding the 'Allow Invalid Certificate' settings in the Nagios Network Analyzer Integration setup ( in the components section).

Let me know if that resolves the issue.

Benjamin

Also, here's our guide on configuring SSL in Nagios XI.

https://assets.nagios.com/downloads/nag ... s%20XI.pdf

Re: Graph not showing

Posted: Thu Mar 25, 2021 9:29 am
by nagmites
Hi Benjamin:

SSL is set to both nna and nagios.
The problem persists.
The chart does not appear in the tab

Regards

Re: Graph not showing

Posted: Thu Mar 25, 2021 6:46 pm
by ssax
If you go to Admin > System Settings > Security and check the box next to "Disable - Do not restrict pages from being opened in iframes from anywhere..." and click the Update Settings button does that fix it?

You can also try adding this to your NNA server's /etc/httpd/conf/httpd.conf:

Code: Select all

Header always set Access-Control-Allow-Origin "*"
Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT"
Then restart apache on the NNA system:

Code: Select all

service httpd restart
Then check to see if XI now shows properly.

Re: Graph not showing

Posted: Mon Mar 29, 2021 4:58 am
by nagmites
Hi there!

I have tried both options, but the problem persists, however the error has changed:

Access to XMLHttpRequest at 'https://vmnagiosna.trabajo.dom/nagiosna ... ip%2Cdstip' from origin 'https://nagiosxi-des.trabajo.dom' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header contains multiple values '*, *', but only one is allowed.

Regards

Re: Graph not showing

Posted: Mon Mar 29, 2021 5:38 pm
by ssax
Try removing this line from your /etc/httpd/conf/httpd.conf on the NNA server and restart the httpd service:

Code: Select all

Header always set Access-Control-Allow-Origin "*"

Code: Select all

systemctl restart httpd
Do you still get that CORS error in the console after that?

Re: Graph not showing

Posted: Tue Mar 30, 2021 4:34 am
by nagmites
Hi there,

The indicated line has been removed and httpd has been restarted.
The error is the one that I attach.

Regards

Re: Graph not showing

Posted: Tue Mar 30, 2021 4:30 pm
by ssax
Please create a ticket for this and include a link back to this forum thread so we can get a remote session setup:

https://support.nagios.com/tickets/

I can replicate the 'Access-Control-Allow-Origin' header contains multiple value issue when I add this to the NNA server:

Code: Select all

Header always set Access-Control-Allow-Origin "*"
Given that's it's saying multiple detected it should already be set and working so we'll need to debug on a remote.

Thank you!