I’m trying to make an item that derives its values from other items. In particular, I have a laser printer, for which I read the current and the max capacity of the toner cartridge via SNMP. Now, I want to create a new item, which holds the current capacity in % of the full capacity.
Here are the items that I have so far:
Number Dell_Toner_K_MaxCapacity "Toner Black Current [%d]" <rgb> (Dell_Printer) { snmp="<[10.0.0.99:public:1.3.6.1.2.1.43.11.1.1.8.1.4:600000]"}
Number Dell_Toner_K_Capacity "Toner Black Max [%d]" <rgb> (Dell_Printer) { snmp="<[10.0.0.99:public:1.3.6.1.2.1.43.11.1.1.9.1.4:600000]"}
Number Dell_Toner_K "Toner Black [%d%%]" <rgb> (Dell_Printer) { snmp="<[10.0.0.99:public:1.3.6.1.2.1.43.11.1.1.9.1.4:600000:JS(Scale_5000.js)]"}
In the item definition of Dell_Toner_K, how can I access the values of Dell_Toner_K_Capacity
and Dell_Toner_k_MaxCapacity
and derive its walue by division (and multiplication by 100)?
I.e. Dell_Toner_K should be =Dell_Toner_K_Capacity/Dell_Toner_K_MaxCapacity*100
So far, the best I could find is to use a JS transformation with a hardcoded max capacity. Whenever I install a new toner cartridge, I have to remember to change the transformation to the actual capacity of the new cartridge.
Thanks,
Reinhold