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

openbsd/diskspace.c needs to scale by 1024

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Won't fix
    • Icon: Minor Minor
    • None
    • 1.6
    • Agent (G)
    • None
    • OpenBSD/i386 -current

      the following patch is needed to report correct disk space values,
      it's likely to also be needed for other OS.

      — src/libs/zbxsysinfo/openbsd/diskspace.c.orig Tue Oct 28 13:24:30 2008
      +++ src/libs/zbxsysinfo/openbsd/diskspace.c Tue Oct 28 13:56:04 2008
      @@ -42,22 +42,22 @@ int get_fs_size_stat(const char *fs, zbx_uint64_t *tot

      #ifdef HAVE_SYS_STATVFS_H
      if (total)

      • *total = (zbx_uint64_t)s.f_blocks * s.f_frsize;
        + *total = (zbx_uint64_t)s.f_blocks * (s.f_frsize / 1024.0);
        if (free)
      • *free = (zbx_uint64_t)s.f_bfree * s.f_frsize;
        + *free = (zbx_uint64_t)s.f_bfree * (s.f_frsize / 1024.0);
        if (used)
      • *used = (zbx_uint64_t)(s.f_blocks - s.f_bfree) * s.f_frsize;
        + *used = (zbx_uint64_t)(s.f_blocks - s.f_bfree) * (s.f_frsize / 1024.0);
        if (pfree)
        *pfree = (double)(100.0 * s.f_bfree) / s.f_blocks;
        if (pused)
        *pused = (double)(100.0 * (s.f_blocks - s.f_bfree)) / s.f_blocks;
        #else
        if (total)
      • *total = (zbx_uint64_t)s.f_blocks * s.f_bsize;
        + *total = (zbx_uint64_t)s.f_blocks * (s.f_bsize / 1024.0);
        if (free)
      • *free = (zbx_uint64_t)s.f_bfree * s.f_bsize;
        + *free = (zbx_uint64_t)s.f_bfree * (s.f_bsize / 1024.0);
        if (used)
      • *used = (zbx_uint64_t)(s.f_blocks - s.f_bfree) * s.f_bsize;
        + *used = (zbx_uint64_t)(s.f_blocks - s.f_bfree) * (s.f_bsize / 1024.0);
        if (pfree)
        *pfree = (double)(100.0 * s.f_bfree) / s.f_blocks;
        if (pused)

            Unassigned Unassigned
            sthen Stuart Henderson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: