summaryrefslogtreecommitdiffstats
path: root/frontends/php/include
diff options
context:
space:
mode:
authorosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-03-06 12:36:19 +0000
committerosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-03-06 12:36:19 +0000
commitd31ab2fdc7a4e1629c62480005e7df1e9c412944 (patch)
treea256fc701506ed857cf429dccf2fa166babc5afb /frontends/php/include
parent9ef27a42a050c16a0e76757507d922b5798eb2ef (diff)
- added 'UNKNOWN' status for elements of map (Eugene)
git-svn-id: svn://svn.zabbix.com/trunk@3871 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include')
-rw-r--r--frontends/php/include/defines.inc.php4
-rw-r--r--frontends/php/include/forms.inc.php64
-rw-r--r--frontends/php/include/locales/en_gb.inc.php2
-rw-r--r--frontends/php/include/maps.inc.php201
4 files changed, 168 insertions, 103 deletions
diff --git a/frontends/php/include/defines.inc.php b/frontends/php/include/defines.inc.php
index ccf394a2..b5fb274d 100644
--- a/frontends/php/include/defines.inc.php
+++ b/frontends/php/include/defines.inc.php
@@ -138,6 +138,10 @@
define("SYSMAP_ELEMENT_TYPE_TRIGGER", 2);
define("SYSMAP_ELEMENT_TYPE_HOST_GROUP",3);
+ define("SYSMAP_ELEMENT_ICON_ON", 0);
+ define("SYSMAP_ELEMENT_ICON_OFF", 1);
+ define("SYSMAP_ELEMENT_ICON_UNKNOWN", 2);
+
define("ITEM_TYPE_ZABBIX",0);
define("ITEM_TYPE_SNMPV1",1);
define("ITEM_TYPE_TRAPPER",2);
diff --git a/frontends/php/include/forms.inc.php b/frontends/php/include/forms.inc.php
index 93528a70..963b88a2 100644
--- a/frontends/php/include/forms.inc.php
+++ b/frontends/php/include/forms.inc.php
@@ -3103,8 +3103,9 @@
elseif($resourcetype == SCREEN_RESOURCE_SIMPLE_GRAPH)
{
// Simple graph
- $result=DBselect("select n.name as node_name,h.host,i.description,i.itemid,i.key_".
- " from hosts h,items i,nodes n where h.hostid=i.hostid and n.nodeid=".DBid2nodeid("i.itemid").
+ $result=DBselect("select n.name as node_name,h.host,i.description,i.itemid,i.key_ from hosts h,items i ".
+ " left join nodes n on n.nodeid=".DBid2nodeid("i.itemid").
+ " where h.hostid=i.hostid ".
" and h.status=".HOST_STATUS_MONITORED." and i.status=".ITEM_STATUS_ACTIVE.
" and i.hostid not in (".get_accessible_hosts_by_user($USER_DETAILS,PERM_READ_ONLY,PERM_MODE_LT).")".
" order by node_name,h.host,i.description");
@@ -3114,7 +3115,8 @@
while($row=DBfetch($result))
{
$description_=item_description($row["description"],$row["key_"]);
- $cmbItems->AddItem($row["itemid"],"(".$row["node_name"].") ".$row["host"].": ".$description_);
+ $row["node_name"] = isset($row["node_name"]) ? "(".$row["node_name"].") " : '';
+ $cmbItems->AddItem($row["itemid"],$row["node_name"].$row["host"].": ".$description_);
}
$form->AddRow(S_PARAMETER,$cmbItems);
@@ -3122,15 +3124,16 @@
elseif($resourcetype == SCREEN_RESOURCE_MAP)
{
// Map
- $result=DBselect("select n.name as node_name, s.sysmapid,s.name from sysmaps s, nodes n".
- " where n.nodeid=".DBid2nodeid("s.sysmapid").
+ $result=DBselect("select n.name as node_name, s.sysmapid,s.name from sysmaps s".
+ " left join nodes n on n.nodeid=".DBid2nodeid("s.sysmapid").
" order by name ");
$cmbMaps = new CComboBox("resourceid",$resourceid);
while($row=DBfetch($result))
{
if(!sysmap_accessiable($row["sysmapid"],PERM_READ_ONLY)) continue;
- $cmbMaps->AddItem($row["sysmapid"],"(".$row["node_name"].") ".$row["name"]);
+ $row["node_name"] = isset($row["node_name"]) ? "(".$row["node_name"].") " : '';
+ $cmbMaps->AddItem($row["sysmapid"],$row["node_name"].$row["name"]);
}
$form->AddRow(S_MAP,$cmbMaps);
@@ -3138,9 +3141,9 @@
elseif($resourcetype == SCREEN_RESOURCE_PLAIN_TEXT)
{
// Plain text
- $result=DBselect("select n.name as node_name,h.host,i.description,i.itemid,i.key_".
- " from hosts h,items i,nodes n where h.hostid=i.hostid and n.nodeid=".DBid2nodeid("i.itemid").
- " and h.status=".HOST_STATUS_MONITORED." and i.status=".ITEM_STATUS_ACTIVE.
+ $result=DBselect("select n.name as node_name,h.host,i.description,i.itemid,i.key_ from hosts h,items i".
+ " left join nodes n on n.nodeid=".DBid2nodeid("i.itemid").
+ " where h.hostid=i.hostid and h.status=".HOST_STATUS_MONITORED." and i.status=".ITEM_STATUS_ACTIVE.
" and i.hostid not in (".get_accessible_hosts_by_user($USER_DETAILS,PERM_READ_ONLY,PERM_MODE_LT).")".
" order by node_name,h.host,i.description");
@@ -3148,7 +3151,8 @@
while($row=DBfetch($result))
{
$description_=item_description($row["description"],$row["key_"]);
- $cmbHosts->AddItem($row["itemid"],"(".$row["node_name"].") ".$row["host"].": ".$description_);
+ $row["node_name"] = isset($row["node_name"]) ? "(".$row["node_name"].") " : '';
+ $cmbHosts->AddItem($row["itemid"],$row["node_name"].$row["host"].": ".$description_);
}
@@ -3173,14 +3177,15 @@
$cmbGroup = new CComboBox("resourceid",$resourceid);
$cmbGroup->AddItem(0,S_ALL_SMALL);
- $result=DBselect("select distinct n.name as node_name,g.groupid,g.name from groups g,nodes n,hosts_groups hg,hosts h ".
+ $result=DBselect("select distinct n.name as node_name,g.groupid,g.name from hosts_groups hg,hosts h,groups g ".
+ " left join nodes n on n.nodeid=".DBid2nodeid("g.groupid").
" where g.groupid in (".get_accessible_groups_by_user($USER_DETAILS,PERM_READ_ONLY).")".
- " and n.nodeid=".DBid2nodeid("g.groupid")." and g.groupid=hg.groupid and hg.hostid=h.hostid ".
- " and h.status=".HOST_STATUS_MONITORED.
+ " and g.groupid=hg.groupid and hg.hostid=h.hostid and h.status=".HOST_STATUS_MONITORED.
" order by node_name,g.name");
while($row=DBfetch($result))
{
- $cmbGroup->AddItem($row["groupid"],"(".$row["node_name"].") ".$row["name"]);
+ $row["node_name"] = isset($row["node_name"]) ? "(".$row["node_name"].") " : '';
+ $cmbGroup->AddItem($row["groupid"],$row["node_name"].$row["name"]);
}
$form->AddRow(S_GROUP,$cmbGroup);
@@ -3188,15 +3193,16 @@
elseif($resourcetype == SCREEN_RESOURCE_SCREEN)
{
$cmbScreens = new CComboBox("resourceid",$resourceid);
- $result=DBselect("select distinct n.name as node_name,s.screenid,s.name from screens s,nodes n ".
- " where n.nodeid=".DBid2nodeid("s.screenid").
+ $result=DBselect("select distinct n.name as node_name,s.screenid,s.name from screens s".
+ " left join nodes n on n.nodeid=".DBid2nodeid("s.screenid").
" order by node_name,s.name");
while($row=DBfetch($result))
{
if(!screen_accessiable($row["screenid"], PERM_READ_ONLY)) continue;
if(check_screen_recursion($_REQUEST["screenid"],$row["screenid"]))
continue;
- $cmbScreens->AddItem($row["screenid"],"(".$row["node_name"].") ".$row["name"]);
+ $row["node_name"] = isset($row["node_name"]) ? "(".$row["node_name"].") " : '';
+ $cmbScreens->AddItem($row["screenid"],$row["node_name"].$row["name"]);
}
@@ -3937,6 +3943,7 @@
$url = $element["url"];
$iconid_off = $element["iconid_off"];
$iconid_on = $element["iconid_on"];
+ $iconid_unknown = $element["iconid_unknown"];
$label_location = $element["label_location"];
if(is_null($label_location)) $label_location = -1;
}
@@ -3950,6 +3957,7 @@
$url = get_request("url", "");
$iconid_off = get_request("iconid_off", 0);
$iconid_on = get_request("iconid_on", 0);
+ $iconid_unknown = get_request("iconid_unknown", 0);
$label_location = get_request("label_location", "-1");
}
@@ -3958,9 +3966,9 @@
$denyed_hosts = get_accessible_hosts_by_user($USER_DETAILS,PERM_READ_ONLY,PERM_MODE_LT);
$allowed_groups = get_accessible_groups_by_user($USER_DETAILS,PERM_READ_ONLY);
- $db_hosts = DBselect("select distinct n.name as node_name,h.hostid,h.host from hosts h,nodes n ".
+ $db_hosts = DBselect("select distinct n.name as node_name,h.hostid,h.host from hosts h".
+ " left join nodes n on n.nodeid=".DBid2nodeid("h.hostid").
" where h.hostid not in(".$denyed_hosts.")".
- " and n.nodeid=".DBid2nodeid("h.hostid").
" order by node_name,h.host");
if($db_hosts)
$cmbType->AddItem(SYSMAP_ELEMENT_TYPE_HOST, S_HOST);
@@ -4014,13 +4022,14 @@
elseif($elementtype==SYSMAP_ELEMENT_TYPE_MAP)
{
$cmbMaps = new CComboBox("elementid",$elementid);
- $db_maps = DBselect("select distinct n.name as node_name,s.sysmapid,s.name from sysmaps s,nodes n ".
- " where ".DBid2nodeid("s.sysmapid")."=n.nodeid".
- " order by node_name,s.name");
+ $db_maps = DBselect('select distinct n.name as node_name,s.sysmapid,s.name from sysmaps s'.
+ ' left join nodes n on n.nodeid='.DBid2nodeid("s.sysmapid").
+ ' order by node_name,s.name');
while($db_map = DBfetch($db_maps))
{
if(!sysmap_accessiable($db_map["sysmapid"],PERM_READ_ONLY)) continue;
- $cmbMaps->AddItem($db_map["sysmapid"],"(".$db_map['node_name'].") ".$db_map["name"]);
+ $node_name = isset($db_map['node_name']) ? '('.$db_map['node_name'].') ' : '';
+ $cmbMaps->AddItem($db_map["sysmapid"],$node_name.$db_map["name"]);
}
$frmEl->AddRow(S_MAP, $cmbMaps);
}
@@ -4084,18 +4093,21 @@
$cmbIconOff = new CComboBox("iconid_off",$iconid_off);
$cmbIconOn = new CComboBox("iconid_on",$iconid_on);
+ $cmbIconUnknown = new CComboBox("iconid_unknown",$iconid_unknown);
$result = DBselect("select * from images where imagetype=1 and ".DBid2nodeid("imageid")."=".$ZBX_CURNODEID." order by name");
while($row=DBfetch($result))
{
$cmbIconOff->AddItem($row["imageid"],$row["name"]);
$cmbIconOn->AddItem($row["imageid"],$row["name"]);
+ $cmbIconUnknown->AddItem($row["imageid"],$row["name"]);
}
- $frmEl->AddRow("Icon (OFF)",$cmbIconOff);
- $frmEl->AddRow("Icon (ON)",$cmbIconOn);
+ $frmEl->AddRow(S_ICON_OFF,$cmbIconOff);
+ $frmEl->AddRow(S_ICON_ON,$cmbIconOn);
+ $frmEl->AddRow(S_ICON_UNKNOWN,$cmbIconUnknown);
$frmEl->AddRow("Coordinate X", new CTextBox("x", $x, 5));
$frmEl->AddRow("Coordinate Y", new CTextBox("y", $y, 5));
- $frmEl->AddRow("URL", new CTextBox("url", $url, 64));
+ $frmEl->AddRow(S_URL, new CTextBox("url", $url, 64));
$frmEl->AddItemToBottomRow(new CButton("save",S_SAVE));
if(isset($_REQUEST["selementid"]))
diff --git a/frontends/php/include/locales/en_gb.inc.php b/frontends/php/include/locales/en_gb.inc.php
index 465e9516..0a4f251c 100644
--- a/frontends/php/include/locales/en_gb.inc.php
+++ b/frontends/php/include/locales/en_gb.inc.php
@@ -527,6 +527,7 @@
"S_NOT_MONITORED"=> "Not monitored",
"S_UNREACHABLE"=> "Unreachable",
"S_TEMPLATE"=> "Template",
+ "S_TEMPLATE_SMALL"=> "template",
"S_DELETED"=> "Deleted",
"S_UNKNOWN"=> "Unknown",
"S_GROUPS"=> "Groups",
@@ -704,6 +705,7 @@
"S_Y"=> "Y",
"S_ICON_ON"=> "Icon (on)",
"S_ICON_OFF"=> "Icon (off)",
+ "S_ICON_UNKNOWN"=> "Icon (unknown)",
"S_ELEMENT_1"=> "Element 1",
"S_ELEMENT_2"=> "Element 2",
"S_LINK_STATUS_INDICATOR"=> "Link status indicator",
diff --git a/frontends/php/include/maps.inc.php b/frontends/php/include/maps.inc.php
index 3962d6a5..507682ac 100644
--- a/frontends/php/include/maps.inc.php
+++ b/frontends/php/include/maps.inc.php
@@ -199,7 +199,7 @@
# Add Element to system map
function add_element_to_sysmap($sysmapid,$elementid,$elementtype,
- $label,$x,$y,$iconid_off,$url,$iconid_on,$label_location)
+ $label,$x,$y,$iconid_off,$iconid_unknown,$iconid_on,$url,$label_location)
{
if($label_location<0) $label_location='null';
if(check_circle_elements_link($sysmapid,$elementid,$elementtype))
@@ -211,10 +211,9 @@
$selementid = get_dbid("sysmaps_elements","selementid");
$result=DBexecute("insert into sysmaps_elements".
- " (selementid,sysmapid,elementid,elementtype,label,x,y,iconid_off,url,iconid_on,label_location)".
+ " (selementid,sysmapid,elementid,elementtype,label,x,y,iconid_off,url,iconid_on,label_location,iconid_unknown)".
" values ($selementid,$sysmapid,$elementid,$elementtype,".zbx_dbstr($label).",
- $x,$y,$iconid_off,".zbx_dbstr($url).",$iconid_on,".
- "$label_location)");
+ $x,$y,$iconid_off,".zbx_dbstr($url).",$iconid_on,$label_location,$iconid_unknown)");
if(!$result)
return $result;
@@ -225,7 +224,7 @@
# Update Element from system map
function update_sysmap_element($selementid,$sysmapid,$elementid,$elementtype,
- $label,$x,$y,$iconid_off,$url,$iconid_on,$label_location)
+ $label,$x,$y,$iconid_off,$iconid_unknown,$iconid_on,$url,$label_location)
{
if($label_location<0) $label_location='null';
if(check_circle_elements_link($sysmapid,$elementid,$elementtype))
@@ -236,7 +235,7 @@
return DBexecute("update sysmaps_elements set elementid=$elementid,elementtype=$elementtype,".
"label=".zbx_dbstr($label).",x=$x,y=$y,iconid_off=$iconid_off,url=".zbx_dbstr($url).
- ",iconid_on=$iconid_on,label_location=$label_location".
+ ",iconid_on=$iconid_on,label_location=$label_location,iconid_unknown=$iconid_unknown".
" where selementid=$selementid");
}
@@ -301,116 +300,164 @@
$element = DBfetch($elements);
if(!$element) return FALSE;
- if(get_info_by_selementid($element["selementid"],$info,$color) != 0)
- $iconid = $element["iconid_on"];
- else
- $iconid = $element["iconid_off"];
+ $info = get_info_by_selementid($element["selementid"]);
- $image = get_image_by_imageid($iconid);
+ $image = get_image_by_imageid($info['iconid']);
if(!$image) return FALSE;
return imagecreatefromstring($image['image']);
}
- function get_info_by_selementid($selementid, &$out_info, &$out_color)
+ function get_info_by_selementid($selementid)
{
global $colors;
- $count = 0;
- $info = S_OK_BIG;
- $color = $colors["Dark Green"];
-
+ $el_name = '';
+ $tr_info = array();
+
$db_element = get_sysmaps_element_by_selementid($selementid);
- if($db_element["elementtype"]==SYSMAP_ELEMENT_TYPE_HOST)
- {
- $db_triggers = DBselect("select distinct t.triggerid, t.priority".
- " from items i,functions f,triggers t,hosts h where h.hostid=i.hostid".
- " and i.hostid=".$db_element["elementid"]." and i.itemid=f.itemid".
- " and f.triggerid=t.triggerid and t.value=1 and t.status=0".
- " and h.status=".HOST_STATUS_MONITORED." and i.status=0");
+ $el_type =& $db_element["elementtype"];
+
+ if(in_array($el_type,
+ array(
+ SYSMAP_ELEMENT_TYPE_HOST,
+ SYSMAP_ELEMENT_TYPE_HOST_GROUP,
+ SYSMAP_ELEMENT_TYPE_TRIGGER
+ )
+ ))
+ {
+ $sql = array(
+ SYSMAP_ELEMENT_TYPE_TRIGGER => 'select distinct t.triggerid, t.priority, t.value, t.description, h.host '.
+ 'from triggers t, items i, functions f, hosts h where t.triggerid='.$db_element['elementid'].
+ ' and h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=t.triggerid '.
+ ' and h.status='.HOST_STATUS_MONITORED.' and i.status='.ITEM_STATUS_ACTIVE.
+ ' and t.status='.TRIGGER_STATUS_ENABLED,
+ SYSMAP_ELEMENT_TYPE_HOST_GROUP => 'select distinct t.triggerid, t.priority, t.value,'.
+ ' t.description, h.host, g.name as el_name '.
+ ' from items i,functions f,triggers t,hosts h,hosts_groups hg,groups g '.
+ ' where h.hostid=i.hostid and hg.groupid=g.groupid and g.groupid='.$db_element['elementid'].
+ ' and hg.hostid=h.hostid and i.itemid=f.itemid'.
+ ' and f.triggerid=t.triggerid and t.status='.TRIGGER_STATUS_ENABLED.
+ ' and h.status='.HOST_STATUS_MONITORED.' and i.status='.ITEM_STATUS_ACTIVE,
+ SYSMAP_ELEMENT_TYPE_HOST => 'select distinct t.triggerid, t.priority, t.value,'.
+ ' t.description, h.host, h.host as el_name'.
+ ' from items i,functions f,triggers t,hosts h where h.hostid=i.hostid'.
+ ' and i.hostid='.$db_element['elementid'].' and i.itemid=f.itemid'.
+ ' and f.triggerid=t.triggerid and t.status='.TRIGGER_STATUS_ENABLED.
+ ' and h.status='.HOST_STATUS_MONITORED.' and i.status='.ITEM_STATUS_ACTIVE
+ );
+
+ $db_triggers = DBselect($sql[$el_type]);
$trigger = DBfetch($db_triggers);
if($trigger)
{
- for($count=1; DBfetch($db_triggers); $count++);
-
- if ($trigger["priority"] > 3) $color=$colors["Red"];
- else $color=$colors["Dark Yellow"];
- $info = expand_trigger_description_simple($trigger["triggerid"]);
+ if(isset($trigger['el_name']))
+ $el_name = $trigger['el_name'];
+ else
+ $el_name = expand_trigger_description_by_data($trigger);
+
+ do {
+ $type =& $trigger['value'];
+
+ if(!isset($tr_info[$type]))
+ $tr_info[$type] = array('count' => 0);
+
+ $tr_info[$type]['count']++;
+ if(!isset($tr_info[$type]['priority']) || $tr_info[$type]['priority'] < $trigger["priority"])
+ {
+ $tr_info[$type]['priority'] = $trigger["priority"];
+ if($el_type != SYSMAP_ELEMENT_TYPE_TRIGGER && $type!=TRIGGER_VALUE_UNKNOWN)
+ $tr_info[$type]['info'] = expand_trigger_description_by_data($trigger);
+ }
+ } while ($trigger = DBfetch($db_triggers));
}
- else
+ elseif($el_type == SYSMAP_ELEMENT_TYPE_HOST)
{
$host = get_host_by_hostid($db_element["elementid"]);
+ $el_name = $host['host'];
if($host["status"] == HOST_STATUS_TEMPLATE)
{
- $color = $colors["Gray"];
- $info = "template";
+ $tr_info[TRIGGER_VALUE_UNKNOWN]['count'] = 1;
+ $tr_info[TRIGGER_VALUE_UNKNOWN]['priority'] = 0;
+ $tr_info[TRIGGER_VALUE_UNKNOWN]['info'] = S_TEMPLATE_SMALL;
}
}
}
- elseif($db_element["elementtype"]==SYSMAP_ELEMENT_TYPE_MAP)
+ elseif($el_type==SYSMAP_ELEMENT_TYPE_MAP)
{
+ $db_map = DBfetch(DBselect('select name from sysmaps where sysmapid='.$db_element["elementid"]));
+ $el_name = $db_map['name'];
+
$db_subelements = DBselect("select selementid from sysmaps_elements".
" where sysmapid=".$db_element["elementid"]);
while($db_subelement = DBfetch($db_subelements))
{// recursion
- if(($curr_count = get_info_by_selementid($db_subelement["selementid"],$curr_info,$curr_color)) > 0)
- {
- $count += $curr_count;
- $info = $curr_info;
- $color = $curr_color;
- }
- }
- }
- elseif($db_element["elementtype"]==SYSMAP_ELEMENT_TYPE_TRIGGER)
- {
- if($db_element["elementid"]>0){
- $trigger=get_trigger_by_triggerid($db_element["elementid"]);
- if($trigger["value"] == TRIGGER_VALUE_TRUE)
- {
- $info=S_TRUE_BIG;
- $color=$colors["Red"];
- $count = 1;
- }
- else
+ $inf = get_info_by_selementid($db_subelement["selementid"]);
+ $type = $inf['type'];
+ if(!isset($tr_info[$type]['count'])) $tr_info[$type]['count'] = 0;
+ $tr_info[$type]['count'] += isset($inf['count']) ? $inf['count'] : 1;
+ if(!isset($tr_info[$type]['priority']) || $tr_info[$type]['priority'] < $inf["priority"])
{
- $info=S_FALSE_BIG;
+ $tr_info[$type]['priority'] = $inf['priority'];
+ $tr_info[$type]['info'] = $inf['info'];
}
}
}
- elseif($db_element["elementtype"]==SYSMAP_ELEMENT_TYPE_HOST_GROUP)
+
+ if(isset($tr_info[TRIGGER_VALUE_TRUE]))
{
- $db_triggers = DBselect("select distinct t.triggerid, t.priority ".
- " from items i,functions f,triggers t,hosts h,hosts_groups hg ".
- " where h.hostid=i.hostid".
- " and hg.groupid=".$db_element["elementid"].
- " and hg.hostid=h.hostid and i.itemid=f.itemid".
- " and f.triggerid=t.triggerid and t.value=1 and t.status=0".
- " and h.status=".HOST_STATUS_MONITORED." and i.status=0");
+ $inf =& $tr_info[TRIGGER_VALUE_TRUE];
- $trigger = DBfetch($db_triggers);
- if($trigger)
- {
- for($count=1; DBfetch($db_triggers); $count++);
+ $out['type'] = TRIGGER_VALUE_TRUE;
+ $out['info'] = S_TRUE_BIG;
- if ($trigger["priority"] > 3) $color=$colors["Red"];
- else $color=$colors["Dark Yellow"];
- $info = expand_trigger_description_simple($trigger["triggerid"]);
- }
- }
+ if($inf['count'] > 1)
+ $out['info'] = $inf['count']." ".S_PROBLEMS_SMALL;
+ else if(isset($inf['info']))
+ $out['info'] = $inf['info'];
+
+ if($inf['priority'] > 3)
+ $out['color'] = $colors['Red'];
+ else
+ $out['color'] = $colors['Dark Red'];
- if($count>1)
+ $out['iconid'] = $db_element['iconid_on'];
+ }
+ elseif(isset($tr_info[TRIGGER_VALUE_UNKNOWN]) && !isset($tr_info[TRIGGER_VALUE_FALSE]))
{
- $out_info = $count." ".S_PROBLEMS_SMALL;
- $out_color = $colors["Red"];
+ $inf =& $tr_info[TRIGGER_VALUE_UNKNOWN];
+
+ $out['type'] = TRIGGER_VALUE_UNKNOWN;
+ $out['info'] = S_UNKNOWN_BIG;
+
+ /* if($inf['count'] > 1)
+ $out['info'] = $inf['count']." ".S_UNKNOWN;
+ else */ if(isset($inf['info']))
+ $out['info'] = $inf['info'];
+
+ $out['color'] = $colors['Gray'];
+ $out['iconid'] = $db_element['iconid_unknown'];
}
else
{
- $out_info = $info;
- $out_color = $color;
+ $inf =& $tr_info[TRIGGER_VALUE_FALSE];
+
+ $out['type'] = TRIGGER_VALUE_FALSE;
+ $out['info'] = S_FALSE_BIG;
+
+ if(isset($inf['info']))
+ $out['info'] = S_OK_BIG;
+
+ $out['color'] = $colors['Dark Green'];
+ $out['iconid'] = $db_element['iconid_off'];
}
- return $count;
+ $out['count'] = $inf['count'];
+ $out['priority'] = $inf['priority'];
+ $out['name'] = $el_name;
+
+ return $out;
}
function get_action_map_by_sysmapid($sysmapid)
@@ -447,12 +494,12 @@
elseif($db_element["elementtype"] == SYSMAP_ELEMENT_TYPE_TRIGGER)
{
if($url=="" && $db_element["elementid"]!=0)
- $url="events.php?triggerid=".$db_element["elementid"];
+ $url="tr_events.php?triggerid=".$db_element["elementid"];
}
elseif($db_element["elementtype"] == SYSMAP_ELEMENT_TYPE_HOST_GROUP)
{
if($url=="" && $db_element["elementid"]!=0)
- $url="events.php?groupid=".$db_element["elementid"];
+ $url="events.php?hostid=0&groupid=".$db_element["elementid"];
}
if($url=="") continue;