Ad Widget

Collapse

Calculated Item Not Working

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dvwyngaa
    Member
    • Mar 2014
    • 49

    #1

    Calculated Item Not Working

    Hi,

    I have two values that I retrieve from UserParameters in the Zabbix Agent. The items store total disk space from a LUN on a SAN. I would like to add the disk space per LUN to form a total diskspace used value.

    I believe this can be achieved using a calculated item. I have tried this, but I get no values returned. My key is called san.total.capacity, my formulate is as follows:

    last("ds5100.lun.size[EWS_DEV_Array_300GB_LUN6]")+
    last("ds5100.lun.size[EWS_DEV_Array_450GB_LUN7]")

    I get no errors in the agent or server log....See attached screenshot of the actual calculated item.

    Am I doing something wrong above?

    Any help will be appreciated.

    Regards,

    Dawid
    Attached Files
  • coreychristian
    Senior Member
    Zabbix Certified Specialist
    • Jun 2012
    • 159

    #2
    I think you need ',0' after your item name in the parameter.

    last("ds5100.lun.size[EWS_DEV_Array_300GB_LUN6]",0)+
    last("ds5100.lun.size[EWS_DEV_Array_450GB_LUN7]",0)

    From the documentation

    Sum of two functions:

    last("net.if.in[eth0,bytes]",0)+last("net.if.out[eth0,bytes]",0)
    If that doesn't work, when you mouse over the red x of the item on the host does it give a specific error message?

    Comment

    • dvwyngaa
      Member
      • Mar 2014
      • 49

      #3
      Hi coreychristian,

      Thanks for the suggestion. I will give it a try and see if it resolves my problem.

      For completeness sake, what does the ",0" denote / mean?

      Regards,

      Dawid

      Comment

      • coreychristian
        Senior Member
        Zabbix Certified Specialist
        • Jun 2012
        • 159

        #4
        The format for the expression of calculated items is the following.

        Code:
        func(<key>|<hostname:key>,<parameter1>,<parameter2>,...)
        In this case ",0" for last would just indicate it's the most recent value.

        Here is the last operation from that section.

        For example,
        last(0) is always equal to last(#1)
        last(#3) - third most recent value (not three latest values)
        The function also supports a second optional time_shift parameter. For example,
        last(0,86400) will return the most recent value one day ago.
        Zabbix does not guarantee exact order of values if more than two values exist within one second in history.

        Comment

        • aib
          Senior Member
          • Jan 2014
          • 1615

          #5
          My typical problem with calculated Items was - my impatience.
          Usually calculated item appeared after (Update interval of first element + Update interval of second element + .... +Update interval of CALCULATED item)

          To make you more happy, change all Update intervals to 1 and wait for a couple of minutes.

          After that, check if you have any Red Cross over the list of Items in Host configuration and fix any problem to remove it.

          And one notes - it's not important to use any ",0" in the last() function.
          My formula for Total Drive Space is:
          Code:
          last("vfs.fs.size[F:,total]")+last("vfs.fs.size[G:,total]")+last("vfs.fs.size[I:,total]")+last("vfs.fs.size[J:,total]")+last("vfs.fs.size[K:,total]")+last("vfs.fs.size[L:,total]")+last("vfs.fs.size[M:,total]")+last("vfs.fs.size[N:,total]")+last("vfs.fs.size[O:,total]")+last("vfs.fs.size[T:,total]")+last("vfs.fs.size[U:,total]")
          One more example - formula for converting Fahrenheit to Celsius
          Code:
          (last("ReadNAS_101:temp1f")-32)/1.8
          As you can see I don't use any ",0" in function "last()"
          Sincerely yours,
          Aleksey

          Comment

          Working...