Uploaded image for project: 'ZABBIX FEATURE REQUESTS'
  1. ZABBIX FEATURE REQUESTS
  2. ZBXNEXT-1664

Inaccurate timekeeping in disk metrics

    XMLWordPrintable

Details

    • Change Request
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 2.0.5
    • None
    • Agent (G)
    • Linux, FreeBSD (at least) affected.

    Description

      As discussed elsewhere, the code in zabbix_agent that extracts kernel disk statistics on Linux makes some assumptions about time that are not correct. This jira request discusses one such issue, and the attached patch strives to fix it.

      The rate conversion calculations being performed in apply_diskstat are using a timer resolution in seconds, as a result of the time(2) use in process_diskstat. While this may appear harmless, it is possible that different calls to time() as we pass over the device list will produce different values (near the second boundary) and this would result in incorrect rate conversion calculations by apply_diskstat.

      There is also no need to request the time inside the loop which iterates over all monitored devices, this can be moved to a single time request outside the loop. If the CPU or other metrics also need accurate timestamping someday (it is somewhat surpising that no timestamps at all are inserted into the CPU metric shmem segment, for example, to reflect when the sample was actually taken), this timestamp would also be available to those.

      Attachments

        Activity

          People

            Unassigned Unassigned
            nathans Nathan Scott
            Votes:
            2 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: