Ad Widget

Collapse

VMware VM CPU Usage % Calculation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • X3n0
    Junior Member
    • Apr 2020
    • 1

    #1

    VMware VM CPU Usage % Calculation

    Hi guys,

    I'm trying to create an item by calculating the CPU Usage in Percentage (%) for the template VM VMware Guests.

    I cannot use vmware.vm.cpu.perfcounter() 'cause I have too many different machines to monitor and couldn't turn-on CPU performance counters per each one.

    I alredy tried calculating it using vmware.vm.cpu.usage[{$URL},{HOST.HOST}] * vmware.hv.hw.cpu.freq[{$URL},{HOST.HOST}] / vmware.vm.cpu.num[{$URL},{HOST.HOST}] but it seems like that is not possible to include an "Hypervisor's key" inside a VM Guest template.
    I even tried inserting the item for VM's HV Name instead of the UUID for the frequency's item -> vmware.hv.hw.cpu.freq[{$URL},"vmware.vm.hv.name[{$URL},{HOST.HOST}]"].

    It seems there's no way to make it work.


    Do you know if there any other ways to obtain the CPU Usage in Percentage?
  • uwillc
    Junior Member
    • Mar 2021
    • 8

    #2
    Try to follow the guide from https://bestmonitoringtools.com/vmwa...er-vm-vsphere/

    Comment

    • acapozzoli@vmsistemi.it
      Junior Member
      • Oct 2021
      • 1

      #3
      Have you solved? When I tried to use this key vmware.vm.perfcounter[{$VMWARE.URL},{HOST.HOST},”cpu/usage[average]”] but i receive an error:

      Invalid key "vmware.vm.perfcounter[{$VMWARE.URL},{$HOST.HOST},”cpu/usage[average]”]" for item "VMware: % CPU Avarage Calc" on "VMware Guest": incorrect syntax near "”]"

      It's this the correct way?

      Thakns in advance

      Comment

      • ysus
        Senior Member
        • Mar 2016
        • 100

        #4
        I know it is too late to replay but the problem might be in quote symbol if you copy/paste key expression from internet.
        Attached Files

        Comment

        • irontmp
          Member
          • Sep 2023
          • 36

          #5
          Originally posted by X3n0
          Hi guys,

          I'm trying to create an item by calculating the CPU Usage in Percentage (%) for the template VM VMware Guests.

          I cannot use vmware.vm.cpu.perfcounter() 'cause I have too many different machines to monitor and couldn't turn-on CPU performance counters per each one.

          I alredy tried calculating it using vmware.vm.cpu.usage[{$URL},{HOST.HOST}] * vmware.hv.hw.cpu.freq[{$URL},{HOST.HOST}] / vmware.vm.cpu.num[{$URL},{HOST.HOST}] but it seems like that is not possible to include an "Hypervisor's key" inside a VM Guest template.
          I even tried inserting the item for VM's HV Name instead of the UUID for the frequency's item -> vmware.hv.hw.cpu.freq[{$URL},"vmware.vm.hv.name[{$URL},{HOST.HOST}]"].

          It seems there's no way to make it work.


          Do you know if there any other ways to obtain the CPU Usage in Percentage?
          If you can't use vmware.vm.cpu.perfcounter(), try this formula for CPU usage percentage:
          perl
          (vmware.vm.cpu.usage[{$URL},{HOST.HOST}] * 100) / (vmware.vm.cpu.num[{$URL},{HOST.HOST}] * vmware.hv.hw.cpu.freq[{$URL},{HOST.HOST}])
          Ensure VMware Tools is installed for better metrics, or consider using custom scripts inside the VMs for direct CPU usage data.

          Comment

          Working...