Hi,
I considered this great product, thank you for the job.
I try to add CPU usage on template and I would like to add a CPU usage per CPU with instance discovery (the same way I've done with disk usage and FileSystem.MountPoints). Is it possible ?
Thank you.
Yes, it's possible.
Create script which query System.CPU.Count from the node and return indexes it as array (e.g. 4 cpu == [0, 1, 2, 3]), then use this script in instance discovery.
Here is the script I use:
cpuCount = AgentReadParameter($node, "System.CPU.Count");
if (cpuCount == null || cpuCount == 1)
return null;
array cpuArray;
for (i = 0; i < cpuCount; i++)
cpuArray[i] = i;
return cpuArray;
Excellent. It works ! Thank you.
Hello,
I tried the script, but it does not work:
Configuration like this:
General:
Description = Average CPU {instance} utilization for last Minute
Data Parameter = System.CPU.Usage({instance}) from NetXMS Agent (Integer)
Instance Discovery:
Instance Discovery method = Script
next line = System.CPU.Count
Instance discovery filter script = your script
Thank you
Rainer
Create the script in the Script Library.
Open the DCI in the template and go to Instance Discovery.
Instance discovery method = Script
Next line = name of script in Script Library
Instance discovery filter script should be left blank. Your script will be called from the Script Library as long you entered the script name in the line above.
Force an instance discovery poll to see if it works.
Thank you, now the script and instance discovery works fine