Ad Widget

Collapse

How do you use an item value twice

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tommyboy
    Junior Member
    • Mar 2010
    • 11

    #1

    How do you use an item value twice

    Hi

    I would like to use an items value twice

    1st To see how much disk has been used
    vfs.fs.size[/data,used] (1st "Store value = As is")

    2nd To see the Rate of Change over time - i.e. MB/s
    vfs.fs.size[/data,used] (2nd "Store value = Delta (speed per second)"

    How do you set this up - given that you can not have duplicate item keys?

    Thanks advance
  • Alexei
    Founder, CEO
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2004
    • 5654

    #2
    It's not possible to have two different items with the same key assigned to a host.

    As a (dirty) workaround you may create slightly different keys having same meaning, like:

    vfs.fs.size[/data,used]
    vfs.fs.size[/data,"used"]

    It should work.
    Alexei Vladishev
    Creator of Zabbix, Product manager
    New York | Tokyo | Riga
    My Twitter

    Comment

    • alisson
      Member
      Zabbix Certified Specialist
      • Nov 2009
      • 70

      #3
      Calculated Item

      You could use a Calculated Item.

      In your example, the key could be vfs.fs.size[/data,used/sec]
      and its expression could put last("vfs.fs.size[/data,used]")

      Finally, put "Store value = Delta (speed per second)".
      __________________
      --
      Alisson Oliveira
      [url]www.zabbix.com.br[/url]
      [url]www.unirede.net[/url]
      Porto Alegre - RS - Brasil

      Comment

      • untergeek
        Senior Member
        Zabbix Certified Specialist
        • Jun 2009
        • 512

        #4
        I tried calculated items too, but if the collection is delayed by even a tiny bit, the window will capture the previous value before the next one comes in, and your delta will have a 0 value.

        Using a second but similar item works well, Alexei. We did something similar to monitor JBoss mbeans via the twiddle.sh monitoring script.

        Comment

        • tommyboy
          Junior Member
          • Mar 2010
          • 11

          #5
          UserParameter how do you use the 1st stored value DB query

          Hi All thanks for the great tips - will test soon.

          I have following 2 postgresql DB UserParameter sql queries - but again it would be nice to only run the DB query once and then reuse the item value for the TPS item. The intention is reduce the number of duplicate DB queries - if it is possible.

          (1st "Store value = As is")
          # Get the total number of commited transactions
          UserParameter=psql.tx_commited,psql -U postgres -t -c "select sum(xact_commit) from pg_stat_database"

          (2nd "Store value = Delta (speed per second)" - but use the value from above.
          # Get the total number of commited transactions again for TPS (Transactions per Second)
          UserParameter=psql.tx_commited_tps,psql -U postgres -t -c "select sum(xact_commit) from pg_stat_database"

          Thanks in advance

          Steven

          Comment

          Working...