Ad Widget

Collapse

CPU util monitor is incomplete/broken (1.6.5 agent)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alj
    Senior Member
    • Aug 2006
    • 188

    #1

    CPU util monitor is incomplete/broken (1.6.5 agent)

    Here's my server CPU state (top output):
    Cpu(s): 0.0%us, 0.0%sy, 0.0%ni, 0.0%id,100.0%wa, 0.0%hi, 0.0%si, 0.0%st

    i e it is waiting for IO
    It used to be in 1.4 version that IO wait time was counting as system seems like and system+nice+idle+user were nicely combined produced 100% most of the time.
    Now (1.6.5) it is not counting as system and I see weird incomplete stacked CPU load graph where all cpu loads including idle are equal to 0:

    # zabbix_get -s h -ksystem.cpu.util[,user]
    0.016598
    # zabbix_get -s h -ksystem.cpu.util[,idle]
    0.000000
    # zabbix_get -s h -ksystem.cpu.util[,system]
    0.049793
    # zabbix_get -s h -ksystem.cpu.util[,nice]
    0.000000
    # zabbix_get -s h -ksystem.cpu.util[,user]
    0.000000
    # zabbix_get -s h -ksystem.cpu.util[,kernel]
    ZBX_NOTSUPPORTED
    # zabbix_get -s h -ksystem.cpu.util[,wait]
    ZBX_NOTSUPPORTED
    # zabbix_get -s h -ksystem.cpu.util[,interrupts]
    ZBX_NOTSUPPORTED
    # zabbix_get -s h -ksystem.cpu.util[,interrupt]
    0.000000


    I think all cpu util loads combined should produce 100% if added otherwise one has no clue where cpu time is going when all metrics are zeroed....
  • Calimero
    Senior Member
    • Nov 2006
    • 481

    #2
    If you're on linux, see function SYSTEM_CPU_UTIL in src/libs/zbxsysinfo/linux/cpu.c:

    Code:
            if ('\0' == *type || 0 == strcmp(type, "user")) /* default parameter */
                    SET_DBL_RESULT(result, collector->cpus.cpu[cpu_num].user[mode])
            else if (0 == strcmp(type, "nice"))
                    SET_DBL_RESULT(result, collector->cpus.cpu[cpu_num].nice[mode])
            else if (0 == strcmp(type, "system"))
                    SET_DBL_RESULT(result, collector->cpus.cpu[cpu_num].system[mode])
            else if (0 == strcmp(type, "idle"))
                    SET_DBL_RESULT(result, collector->cpus.cpu[cpu_num].idle[mode])
            else if (0 == strcmp(type, "iowait"))
                    SET_DBL_RESULT(result, collector->cpus.cpu[cpu_num].iowait[mode])
            else if (0 == strcmp(type, "interrupt"))
                    SET_DBL_RESULT(result, collector->cpus.cpu[cpu_num].interrupt[mode])
            else if (0 == strcmp(type, "softirq"))
                    SET_DBL_RESULT(result, collector->cpus.cpu[cpu_num].softirq[mode])
            else if (0 == strcmp(type, "steal"))
                    SET_DBL_RESULT(result, collector->cpus.cpu[cpu_num].steal[mode])
            else
                    return SYSINFO_RET_FAIL;
    Here's the parameters currently supported.

    Comment

    • alj
      Senior Member
      • Aug 2006
      • 188

      #3
      Originally posted by Calimero
      If you're on linux, see function SYSTEM_CPU_UTIL in src/libs/zbxsysinfo/linux/cpu.c:

      Code:
              if ('\0' == *type || 0 == strcmp(type, "user")) /* default parameter */
                      SET_DBL_RESULT(result, collector->cpus.cpu[cpu_num].user[mode])
              else if (0 == strcmp(type, "nice"))
                      SET_DBL_RESULT(result, collector->cpus.cpu[cpu_num].nice[mode])
              else if (0 == strcmp(type, "system"))
                      SET_DBL_RESULT(result, collector->cpus.cpu[cpu_num].system[mode])
              else if (0 == strcmp(type, "idle"))
                      SET_DBL_RESULT(result, collector->cpus.cpu[cpu_num].idle[mode])
              else if (0 == strcmp(type, "iowait"))
                      SET_DBL_RESULT(result, collector->cpus.cpu[cpu_num].iowait[mode])
              else if (0 == strcmp(type, "interrupt"))
                      SET_DBL_RESULT(result, collector->cpus.cpu[cpu_num].interrupt[mode])
              else if (0 == strcmp(type, "softirq"))
                      SET_DBL_RESULT(result, collector->cpus.cpu[cpu_num].softirq[mode])
              else if (0 == strcmp(type, "steal"))
                      SET_DBL_RESULT(result, collector->cpus.cpu[cpu_num].steal[mode])
              else
                      return SYSINFO_RET_FAIL;
      Here's the parameters currently supported.
      Oh, thanks for that. I assume then that documentation is outdated....

      Comment

      Working...