Ad Widget

Collapse

PATCH: better target links for maps

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Vince2
    Member
    • Oct 2006
    • 40

    #1

    PATCH: better target links for maps

    Hi !

    The following patch correctly link to tr_status.php. Without it, we can get tr_status.php for an unrelated group instead of tr_status.php for the selected host.

    Code:
    diff --git a/frontends/php/include/maps.inc.php b/frontends/php/include/maps.inc.php
    index fed3c49..44ee94d 100644
    --- a/frontends/php/include/maps.inc.php
    +++ b/frontends/php/include/maps.inc.php
    @@ -367,7 +367,7 @@
     
     			
     				if($url=="")
    -					$url="tr_status.php?hostid=".$db_element["elementid"].
    +					$url="tr_status.php?groupid=0&hostid=".$db_element["elementid"].
     						"&noactions=true&onlytrue=true&compact=true";
     
     				$alt = "Host: ".$host["host"]." ".$alt;
    The following patch links to tr_status.php for hosts groups instead of linking to events.php. I think this is better.

    Code:
    diff --git a/frontends/php/include/maps.inc.php b/frontends/php/include/maps.inc.php
    index 73e1401..fed3c49 100644
    --- a/frontends/php/include/maps.inc.php
    +++ b/frontends/php/include/maps.inc.php
    @@ -389,7 +389,7 @@
     			elseif($db_element["elementtype"] == SYSMAP_ELEMENT_TYPE_HOST_GROUP)
     			{
     				if($url=="" && $db_element["elementid"]!=0)
    -					$url="events.php?groupid=".$db_element["elementid"];
    +					$url="tr_status.php?hostid=0&noactions=true&onlytrue=true&compact=true&groupid=".$db_element["elementid"];
     			}
     
     			if($url=="")	continue;
Working...