Ad Widget

Collapse

Zabbix 1.5 - Modified Items Query in latest.php

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Palmertree
    Senior Member
    • Sep 2005
    • 746

    #1

    Zabbix 1.5 - Modified Items Query in latest.php

    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:

    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'));
    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
  • Aly
    ZABBIX developer
    • May 2007
    • 1126

    #2
    1. It's not so big overhead or I'm wrong!?
    2. I've already committed the fix to this bug
    Zabbix | ex GUI developer

    Comment

    • Palmertree
      Senior Member
      • Sep 2005
      • 746

      #3
      Not really much a big overhead in terms of speed but just php script memory. :-)

      Comment

      Working...