LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   nagios web GUI change default page (https://www.linuxquestions.org/questions/linux-server-73/nagios-web-gui-change-default-page-884161/)

junust 06-02-2011 11:00 AM

nagios web GUI change default page
 
When you first access Nagios, it displays the Home page (the Nagios Core version and check for updates page). I would like to have a way to change the default page to either the Tactical Overview display or the Services display.

This question was asked here, but not answered


http://ideas.nagios.org/a/dtd/13466-3955


So, is there a way to accomplish this

Thanks

kirukan 06-02-2011 12:42 PM

Make the changes on nagios index page to display first page as Tactical Overview

junust 06-02-2011 04:38 PM

@kirukan

Do you really tried to do this before you answering my question, or it is just for the posts count ?




P.S
without any intent to hurt

kirukan 06-04-2011 01:50 AM

Quote:

Originally Posted by junust (Post 4374483)
@kirukan

Do you really tried to do this before you answering my question, or it is just for the posts count ?

I don't wanna do chilly things to increase count(If i am, such person at the moment my post count will be more than two thousands or more ). If you wish just go through all of my post how many times I replied Nagios & SNMP related threads and a small information I had integrated Nagios hundreds more time in my work environment.

richardlynch 03-27-2012 01:06 PM

Quote:

Originally Posted by junust (Post 4374227)
When you first access Nagios, it displays the Home page (the Nagios Core version and check for updates page). I would like to have a way to change the default page to either the Tactical Overview display or the Services display.

This question was asked here, but not answered


http://ideas.nagios.org/a/dtd/13466-3955


So, is there a way to accomplish this

Thanks

To be more specific for kirukan's answer, which is completely correct and reasonable:
In your /usr/share/nagios/htdocs/index.php file (yours may be somewhere else [1]) there is a line like this:
$corewindow="main.php";

Change it to this:
(or even add it below, to document your over-ride of the default)
$corewindow="cgi-bin/tac.cgi";

[1] To find your nagios index.php, something like this should work:
locate index.php | grep nagios

richardlynch 03-27-2012 01:09 PM

Quote:

Originally Posted by junust (Post 4374227)
When you first access Nagios, it displays the Home page (the Nagios Core version and check for updates page). I would like to have a way to change the default page to either the Tactical Overview display or the Services display.

This question was asked here, but not answered


http://ideas.nagios.org/a/dtd/13466-3955


So, is there a way to accomplish this

Thanks

PS
A similar change in side.php in the HTML A link tag would change the "Home" link in the left-hand side, if you so desire.

hariboukis 05-26-2015 06:39 PM

Graceful solution:
 
To specify a different page than the home page, use the URL line. Start off with:

YOUR_DOMAIN_NAME/?corewindow=

...then add the link to the page you want to open in the frame:

/nagios/cgi-bin/status.cgi?host=all

So you end up with something like:

YOUR_DOMAIN_NAME/?corewindow=/nagios/cgi-bin/status.cgi?host=all

You can find the page names from the left hand menu in nagios. Just look at what they reference, and extract the end part of that address.

No code modified.

Cheers!

aagaag 07-31-2016 01:49 AM

In my Nagios (version 4.1.1) there is no such line in index.php. Instead, the php reads:
Code:

<?php
// Allow specifying main window URL for permalinks, etc.
$url = 'main.php';

if (isset($_GET['corewindow'])) {

        // The default window url may have been overridden with a permalink...
        // Parse the URL and remove permalink option from base.
        $a = parse_url($_GET['corewindow']);

        // Build the base url.
        $url = htmlentities($a['path']).'?';
        $url = (isset($a['host'])) ? $a['scheme'].'://'.$a['host'].$url : '/'.$url;

        $query = isset($a['query']) ? $a['query'] : '';
        $pairs = explode('&', $query);
        foreach ($pairs as $pair) {
                $v = explode('=', $pair);
                if (is_array($v)) {
                        $key = urlencode($v[0]);
                        $val = urlencode(isset($v[1]) ? $v[1] : '');
                        $url .= "&$key=$val";
                }
        }
}

$this_year = '2015';
?>

if I change
Code:

$url = 'main.php'; # this was the original line
to:
Code:

$url = 'cgi-bin/status.cgi?hostgroup=all&style=hostdetail';
browsing nagios results in a "403 Forbidden" error in the main window.

ASHOKROYAL 06-05-2019 05:35 AM

to change home page of Nagios
 
I would suggest dont make any changes in intex.php please go through below link its apache problem

https://stackoverflow.com/questions/...d-of-executing


All times are GMT -5. The time now is 11:08 AM.