Open GoogleCodeExporter opened 8 years ago
Just make yourself a new Calculated Key that multiplies number of cores key and
total Hz key. Something like this:
last("esx.cpu.load[{HOST.DNS},cores]") * last("esx.cpu.load[{HOST.DNS},total]")
Make a new unique key and save it. Simple as that.
Original comment by michal.b...@gmail.com
on 6 Sep 2012 at 6:54
This calculation only works for ESX servers and not for the virtual machine.
It is necessary to return an item that the quantity of cores for virtual
machine.
Original comment by rafael.i...@gmail.com
on 6 Sep 2012 at 3:34
Add the following code to vmbix.java which will create a new item
vm.cpu.load[{HOST.DNS},count] which will return the number of cores allocated
to the VM
Pattern pVmCpuCount =
Pattern.compile("^(?:\\s*ZBXD.)?.*vm\\.cpu\\.load\\[(.+),count\\]"
);
.
.
found = checkPattern(pVmCpuCount ,string); if (found != null) {
getVmCpuCount (found, out); return; }
.
.
private void getVmCpuCount (String vmName, PrintWriter out)
throws IOException {
long start = System.currentTimeMillis();
VirtualMachine vm = (VirtualMachine)getManagedEntityByName(vmName,"VirtualMachine");
Integer amount;
if (vm == null) {
long end = System.currentTimeMillis();
System.out.print("No vm named '" + vmName + "' found\n");
amount = 0;
} else {
VirtualMachineSummary vmSummary = vm.getSummary();
VirtualMachineConfigSummary vmConfigSum = vmSummary.getConfig();
amount = vmConfigSum.getNumCpu();
if (amount == null) { amount = 0; }
long end = System.currentTimeMillis();
}
out.print(amount + "\n");
out.flush();
}
Original comment by palin...@gmail.com
on 14 May 2013 at 3:00
Original issue reported on code.google.com by
badger.s...@gmail.com
on 7 Mar 2012 at 1:04