Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-923

Queue calculation in php frontend buggy? Zabbix 1.6.4

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Incomplete
    • Icon: Major Major
    • 1.6
    • 1.6
    • Frontend (F)
    • None
    • ubuntu 8.04 lts, mysql 5.0.75

      Since recently one of my Zabbix Servers shows a lot of Items queuing up. This seems to be independent from things like agent reachability, server load and basically almost everything.

      After a long search for the cause i think i found the bug to be just in the queue.php, so there is no real problem with monitoring, just with the queue display. Can this problem be confirmed by anyone?

      In queue.php, in the query that does select the candidates for queue display, there is one line commented out, as it seems this is just the line that very sanely would prevent checks that are not lagging behind from showing up:
      [QUOTE]/* ' AND i.nextcheck + 5 <'.$now.*/[/QUOTE]
      Commenting this line in again seems to resolve my problems, as it seems sane that checks which are not overdue for at least 5 seconds should not be considered at all.

      But I'm unsure of just adding this line in again. Zabbix later does calculate the value of "nextcheck" by calculations including the time of the last check "lastclock" with the delay between checks.
      [QUOTE]calculate_item_nextcheck($row['itemid'], $row['type'], $row['delay'], $row['delay_flex'], $row['lastclock']);[/QUOTE]

      This function is defined in include/items.inc.php, which in any case, before returning the result calculates the time for the next check not simply by lastclock+delay (if i change it to that, the queue display also seems to work well) but in a more complicated way, to spread the times new checks pop up . This function in the end makes sure, the returned value is bigger than lastclock, but not necesserily bigger than $now (talking of $now in queue.php, which is a real $now, while $now in items.inc.php is actually lastclock). I also dont want to change this function, as it is used in other functions besides queue.php aswell.
      [QUOTE]
      function calculate_item_nextcheck($itemid, $item_type, $delay, $delay_flex, $now)
      [...]
      while ($nextcheck <= $now)

      { $nextcheck += $delay; }

      return $nextcheck;[/QUOTE]

      PS: According to the logs of zabbix_server, the processes pick their checks plainly by "nextcheck":
      [QUOTE]select i.itemid,i.key_,h.host,h.port,i.delay,i.description,i.nextcheck,i.type,i.snmp_community,i.snmp_oid,h.useip,h.ip,i.history,i.lastvalue,i.prevvalue,i.hostid,h.status,i.value_type,h.errors_from,i.snmp_port,i.delta,i.prevorgvalue,i.lastclock,i.units,i.multiplier,i.snmpv3_securityname,i.snmpv3_securitylevel,i.snmpv3_authpassphrase,i.snmpv3_privpassphrase,i.formula,h.available,i.status,i.trapper_hosts,i.logtimefmt,i.valuemapid,i.delay_flex,h.dns,i.params,i.trends,h.useipmi,h.ipmi_port,h.ipmi_authtype,h.ipmi_privilege,h.ipmi_username,h.ipmi_password,i.ipmi_sensor,i.lastlogsize from hosts h, items i where i.nextcheck<=UNIX_TIMESTAMP() and h.hostid=i.hostid and h.status=0 and i.status in (0,3) and ((h.disable_until<=1242220375 and h.errors_from=0 and i.type in (0,1,4,6)) or i.type in (3,5,8,10,11)) and (h.proxy_hostid=0 or i.type in (5)) and mod(i.itemid,1)=0 and i.key_ not in ('status','icmpping','icmppingsec','zabbix[log]') and h.hostid between 100000000000000 and 199999999999999;[/QUOTE]

            Unassigned Unassigned
            markus.knye Markus Knye
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: