Views section: Newly added view does not display

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Phisith
Posts: 11
Joined: Fri May 25, 2018 1:14 pm

Views section: Newly added view does not display

Post by Phisith »

Nagios XI, version 5.4.13

After adding a new view:
- Nothing happens when clicking on the newly added view
- View doesn’t show up in the view rotation

Steps to repro:
1. Click on ‘Views’ --> “Add New View”
2. Enter title and URL and click submit
3. Under ‘My Views’, click on the new link that was added
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Views section: Newly added view does not display

Post by lmiltchev »

I was not able to recreate the issue in Nagios XI 5.4.13. I added a new view:
example01.PNG
and I can see if just fine. It is also included in the rotation.
example02.PNG
What is the URL that you are using? Do you see any errors when you inspect the element in the browser (F12)?
You do not have the required permissions to view the files attached to this post.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Phisith
Posts: 11
Joined: Fri May 25, 2018 1:14 pm

Re: Views section: Newly added view does not display

Post by Phisith »

No external link works. The screenshot is a test for www.google.com. It doesn't show anything except for a blank page.
You do not have the required permissions to view the files attached to this post.
Phisith
Posts: 11
Joined: Fri May 25, 2018 1:14 pm

Re: Views section: Newly added view does not display

Post by Phisith »

After pressing F12. I see an error "The requested URL /nagios/views/www.google.com was not found on this server (see F12_error-2.png).
F12_error-2.png
And also notice a java error on the debug screen (see F12_error-1.png).
F12_error-1.png
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Views section: Newly added view does not display

Post by lmiltchev »

Google won't work - it's a setting on their site. They don't allow loading iframes in the browser (as many other sites). Try adding 'https://www.nagios.com/'. Did this work?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Phisith
Posts: 11
Joined: Fri May 25, 2018 1:14 pm

Re: Views section: Newly added view does not display

Post by Phisith »

https://www.nagios.com/ worked.

Is there a way for me to check if a site will work in the Nagios XI view rotation (short of adding it and see what happens)?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Views section: Newly added view does not display

Post by scottwilkerson »

Phisith wrote:https://www.nagios.com/ worked.

Is there a way for me to check if a site will work in the Nagios XI view rotation (short of adding it and see what happens)?
No, you pretty much are going to have to trial/error.

I will note you need to add the full url including https:// otherwise XI thinks it is local and just a path on the nagios server.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Views section: Newly added view does not display

Post by lmiltchev »

@Phisith, you could use a php script to try to find out if you could use this website in Views.

Example php script (test.php):

Code: Select all

#!/usr/bin/php
<?php
$url = $argv[1];
$header = get_headers($url, 1);
//echo $header["X-Frame-Options"];
if ((@$header["X-Frame-Options"] == "DENY") || (@$header["X-Frame-Options"] == "SAMEORIGIN") || (@$header["X-Frame-Options"] == "ALLOW-FROM")) {
        echo "You can't use this website\n\r";
} else {
        echo "Go ahead. You can use this website\n\r";
}
?>
The way you would use it is by running the following from the command line:

Code: Select all

php test.php <url>
where you substitute <url> with the actual URL of the website. See below:

Code: Select all

[root@main-nagios-xi tmp]# php test.php https://www.npr.org
Go ahead. You can use this website
[root@main-nagios-xi tmp]# php test.php https://www.yahoo.com
You can't use this website
Hope this helps.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Phisith
Posts: 11
Joined: Fri May 25, 2018 1:14 pm

Re: Views section: Newly added view does not display

Post by Phisith »

Nice! Thank you for the php script.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Views section: Newly added view does not display

Post by lmiltchev »

You are welcome! Can we close this topic?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked