Ad Widget

Collapse

Problems With CPU Utilization (no I'm not saying CPU Load =))

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • daffyduck
    Junior Member
    • Oct 2006
    • 4

    #1

    Problems With CPU Utilization (no I'm not saying CPU Load =))

    Hello everybody. I'm having problem with zabbix to get CPU Utilization. I'm using zabbix as a virtual machine in a Xen environment, everything is ok (I really like the way zabbix is doing its stuff), but I'm having problem with CPU Utilization Measure. Let me clarify my environment: The hypervisors are two Debian Etch machines and my virtual machines are Debian Sarge, I'm using Zabbix Server 1.1.2 with MySQL and my zabbix agents are 1.1. Do I need some extra package in my systems to be able to see cpu utilization? Why it is always flat on zero when top or xentop are displaying other values? I've tried all that I’ve found in zabbix forums but none of them worked (system.cpu.util[,system,avg1], system.cpu.util[,,], system.cpu.util[]). With the hypervisors (that are Debian Etch) at least I get a zero value, but with the virtual machines, Zabbix says it is not supported. How Zabbix gets this information? If there are any other possibilities I would be glad to know. I really need to get these values. That's all for now, I appreciate your attention.
  • bibi23
    Member
    • Oct 2005
    • 64

    #2
    same problem

    Hello,

    I have the same proble with zabbix 1.1, 1.1.1 or 1.1.2.
    I install zabbix into Virtual Machine (Vmware) and the cpu.util value is not supported by zabbix_agentd.
    With 1.1beta2, system.cpu.user1 works fine.

    What's wrong with the latest version ?

    Thanks

    Comment

    • RandySpinaGE
      Member
      • Jun 2006
      • 57

      #3


      Use a UserParameter

      UserParameter=cpu.four,sar -P ALL 1 2 | grep Average | grep -A 5 "%idle" | tail -n 1 | awk -F " " '{print 100.0 - $ 7}'

      Comment

      • bibi23
        Member
        • Oct 2005
        • 64

        #4
        Hi,

        I don't understand why there is a system.cpu.load and not system.cpu.util.
        And I don't think the userParameter with sar is a great solution (windows OS ???) and this should use huge systeme ressource.
        There is cpu counter (user, nice, system) in zabbix.1.1beta2, so why is it not supported with latest version ???

        Thanks

        Comment

        • daffyduck
          Junior Member
          • Oct 2006
          • 4

          #5
          Mpstat & UserParameter solution.

          Hello folks, I'm tired of trying to find a zabbix way, so I've made my own solution. It consists of mpstat and UserParameter. Using mpstat I can get detailed information about my CPU utilization as (%sys, %user, %iowait, etc). To achieve this I've had to put the following options on my zabbix_agentd.conf:

          UserParameter=system.mpstat.user, mpstat 1 1 | grep Average | tr -s " " | cut -d " " -f 3
          UserParameter=system.mpstat.user.avg, mpstat | grep all | tr -s " " | cut -d " " -f 4
          UserParameter=system.mpstat.nice, mpstat 1 1 | grep Average | tr -s " " | cut -d " " -f 4
          UserParameter=system.mpstat.nice.avg, mpstat | grep all | tr -s " " | cut -d " " -f 5
          UserParameter=system.mpstat.sys, mpstat 1 1 | grep Average | tr -s " " | cut -d " " -f 5
          UserParameter=system.mpstat.sys.avg, mpstat | grep all | tr -s " " | cut -d " " -f 6
          UserParameter=system.mpstat.iowait, mpstat 1 1 | grep Average | tr -s " " | cut -d " " -f 6
          UserParameter=system.mpstat.iowait.avg, mpstat | grep all | tr -s " " | cut -d " " -f 7
          UserParameter=system.mpstat.irq, mpstat 1 1 | grep Average | tr -s " " | cut -d " " -f 7
          UserParameter=system.mpstat.irq.avg, mpstat | grep all | tr -s " " | cut -d " " -f 8
          UserParameter=system.mpstat.soft, mpstat 1 1 | grep Average | tr -s " " | cut -d " " -f 8
          UserParameter=system.mpstat.soft.avg, mpstat | grep all | tr -s " " | cut -d " " -f 9
          UserParameter=system.mpstat.idle, mpstat 1 1 | grep Average | tr -s " " | cut -d " " -f 10
          UserParameter=system.mpstat.idle.avg, mpstat | grep all | tr -s " " | cut -d " " -f 11

          On the web interface I’ve created items to be able to see the received information using the above keys (system.mpstat.use, system.mpstst.user.avg, etc). For example, if you want to get the %user utilization you need to create an item using the “system.mpstat.user” as a key, set the “Type of Information” to float number and adjust the “Update Interval” as your needs. I’ve found some problems with this solution, because of its dependence on the output values returned from mpstat. As a countermeasure I’ve had to change the “ –f values” depending on mpstat version being used. It’s not actually a problem but it bored the heck out of me.

          "They're never going to make it easy...
          Of this you can be sure."

          That’s all folks .

          Comment

          • bibi23
            Member
            • Oct 2005
            • 64

            #6
            cpu.util works but...

            Hi,

            i re-test system.cpu.util and it's works fine.
            But there are problems with the test fonctionnality of agent.
            when i run zabbix_agentd -t system.cpu.util[all,idle,avg1], i get not supported because the temporary file (/tmp/zabbix_agent.tmp) is not present. If zabbix_agentd is running, previous command works.
            For windows binary, i always get 0 for cpu value, even if the agent is running.

            Thanks

            Comment

            Working...