Found that the items queries was pulling in all the item fields when it was not necessary. I just modified my query around line number 206 in latest.php to look as follows:
Also, if a host contains no applications associated with it, the hostname will not show up in latest data if "all" host is select. To fix this I changed "$any_app_exist = false;" to "$any_app_exist = true;" around line number 196 in latest.php
Code:
while($db_app = DBfetch($db_applications)){
$db_items = DBselect('SELECT DISTINCT i.itemid,i.description,i.lastclock,i.key_,i.lastvalue,i.prevvalue,i.value_type,i.units,i.valuemapid '.
' FROM items i,items_applications ia'.
' WHERE ia.applicationid='.$db_app['applicationid'].
' AND i.itemid=ia.itemid'.
' AND i.status='.ITEM_STATUS_ACTIVE.
order_by('i.description,i.itemid,i.lastclock'));
Comment