I have a question about doing math operations on macro values.
I'm using an external check to query wmi-data from several hosts. In this particular case I'm requesting cpu-usage. The check returns a json with data for all individual cpu's from that host. I use the 'name' value from that json for a LLD that is used in an item protype. The prototyp item is named 'Processor {#CPUID}' , with #CPUID being the name-value. This results in items created for every available cpu, named 'Processor 0', 'Processor 1', 'Processor 2', etcetera. This al works very well.
But instead of starting with 'Processor 0', I'd like it to be named 'Processor 1', and 'Processor 1' renamed 'Processor 2' and so on. Is there some way to do a 'plus one' operation on the [#CPUID} macro value before I use it in the item name?
I'm using an external check to query wmi-data from several hosts. In this particular case I'm requesting cpu-usage. The check returns a json with data for all individual cpu's from that host. I use the 'name' value from that json for a LLD that is used in an item protype. The prototyp item is named 'Processor {#CPUID}' , with #CPUID being the name-value. This results in items created for every available cpu, named 'Processor 0', 'Processor 1', 'Processor 2', etcetera. This al works very well.
But instead of starting with 'Processor 0', I'd like it to be named 'Processor 1', and 'Processor 1' renamed 'Processor 2' and so on. Is there some way to do a 'plus one' operation on the [#CPUID} macro value before I use it in the item name?
Comment