Search code examples
zabbix

Calculated items Zabbix


I've only been studying Zabbix for two mere weeks. I've been finding my way around the software pretty well, yet I don't really seem to understand calculated items.

I'm sure you've heard it before. I want to monitor the ink level on one of my printers. I've already obtained the OID's that are bound to the ink levels. The value of 100% would be '8000'. So 50% would be 4000.

I've checked out the Zabbix guide, but that didn't really seem to help me out. I understand the concept it tries to explain, but I don't understand what exact parameters I should be using. This is what I have so far, which is obviously not working.

100*last("cyan")/last("8000")

I've created five seperate items, one for each colour and one that is simply the value '8000'. Could anyone give me a little bit of insight? I'd love to get more familiar with the software due to it's near endless possibilities!

Many thanks,

Thomas.


Solution

  • Item of just "8000" is most likely not needed. You said "obviously not working", but did not say how it fails. In any case, the following should work - assuming you have an item with key "cyan" and that item is getting values.

    last(cyan)/80
    

    You haven't specified what is your goal, but the above will return %, assuming 8000 is 100%.

    So that's about calculated items. You actually don't need them if all you want is the value in % and the scale is the same for all of them. Instead of adding yet another item (the calculated one), do the calculation right in the original item - set the custom multiplier to 0.0125. This was configured differently in earlier versions of Zabbix, see the corresponding version in the manual if using something older than 3.4.