summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/maps.inc.php
diff options
context:
space:
mode:
authorosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-05-29 12:17:48 +0000
committerosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-05-29 12:17:48 +0000
commit9c78757e848abf4b8dc4546ccd31a2a1992ad41d (patch)
treee93aeaaef44ede48927a2873b23369d572a746b9 /frontends/php/include/maps.inc.php
parent35737f65eb2362b2dddaacacc752254d54e57a91 (diff)
downloadzabbix-9c78757e848abf4b8dc4546ccd31a2a1992ad41d.tar.gz
zabbix-9c78757e848abf4b8dc4546ccd31a2a1992ad41d.tar.xz
zabbix-9c78757e848abf4b8dc4546ccd31a2a1992ad41d.zip
- fixed map status displaying
git-svn-id: svn://svn.zabbix.com/trunk@4196 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/maps.inc.php')
-rw-r--r--frontends/php/include/maps.inc.php58
1 files changed, 30 insertions, 28 deletions
diff --git a/frontends/php/include/maps.inc.php b/frontends/php/include/maps.inc.php
index 02976811..b4528584 100644
--- a/frontends/php/include/maps.inc.php
+++ b/frontends/php/include/maps.inc.php
@@ -335,43 +335,39 @@
$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,
+ 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
+ );
+ if( isset($sql[$el_type]) )
{
- $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)
{
if(isset($trigger['el_name']))
+ {
$el_name = $trigger['el_name'];
+ }
else
+ {
$el_name = expand_trigger_description_by_data($trigger);
+ }
do {
$type =& $trigger['value'];
@@ -398,6 +394,12 @@
$tr_info[TRIGGER_VALUE_UNKNOWN]['priority'] = 0;
$tr_info[TRIGGER_VALUE_UNKNOWN]['info'] = S_TEMPLATE_SMALL;
}
+ else
+ {
+ $tr_info[TRIGGER_VALUE_FALSE]['count'] = 0;
+ $tr_info[TRIGGER_VALUE_FALSE]['priority'] = 0;
+ $tr_info[TRIGGER_VALUE_FALSE]['info'] = S_OK_BIG;
+ }
}
}
elseif($el_type==SYSMAP_ELEMENT_TYPE_MAP)