Ad Widget

Collapse

Using Calculated Items in Templates?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • netmon
    Member
    • Feb 2012
    • 30

    #1

    Using Calculated Items in Templates?

    Dear all,

    Is it possible to use Calculated Items in Templates? (Version 1.8.10)

    I try to calculate free RAM in percent for two SNMP Items.

    Used Memory: KEY_NAME_OF_OIDA
    Avail Memory: KEY_NAME_OF_OIDB
    Template Name: TEMPL_NAME

    Formula:
    last({TEMPL_NAME:KEY_OF_OIDA})/last({TEMPL_NAME:KEY_OF_OIDB})*100

    Something seems to be wrong. I do not get a value with the above formula.
    If I replace TEMPL_NAME with any NAME_OF_HOST (for which I build the template) it works.
    Therefore it seems, that I cannot build Calculated Items through Templates.

    Do I need to create this kind of Items PER HOST?!

    Any Idea? :/
  • JBo
    Senior Member
    • Jan 2011
    • 310

    #2
    Hi,

    I use calculated items in templates and they are working.

    For example, this is what I use for "Used memory" :
    Code:
    last(vm.memory.size[total])-last(vm.memory.size[free])
    I think that your syntax is wrong.
    Could you try :
    Code:
    last(KEY_OF_OIDA)/last(KEY_OF_OIDB)*100
    Hope this helps
    JBo

    Comment

    • netmon
      Member
      • Feb 2012
      • 30

      #3
      Thank you JBo, you are right!

      I use {TEMPL_NAME:KEY_OF_OIDA.last(0)} inside Graphs for my SNMP Items and thought this would be similar for Calculated Items. Wrong!

      Simply using last(KEY_OF_OIDA) is fine... :-)

      Comment

      • thiagomz
        Member
        • Jan 2010
        • 74

        #4
        What can be Wrong...


        last(vm.memory.size[total])-(last(vm.memory.size[free])+last(vm.memory.size[cached])

        Comment

        • thiagomz
          Member
          • Jan 2010
          • 74

          #5
          Originally posted by thiagomz
          What can be Wrong...


          last(vm.memory.size[total])-(last(vm.memory.size[free])+last(vm.memory.size[cached])

          It worked !

          last(vm.memory.size[total])-last(vm.memory.size[free])-last(vm.memory.size[cached])

          Comment

          • zabbixei
            Junior Member
            • Dec 2014
            • 24

            #6
            I need copy of template for calculated items

            Hello Guys,

            can you someone give me a copy of calculated items template i know the formulas but i do not how i am suppose to add them to template.

            thank you in advance.

            John

            Comment

            Working...