Ad Widget

Collapse

How to view the monitoring result of the subtraction of two items?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ales Ulrych
    Member
    • Dec 2016
    • 36

    #1

    How to view the monitoring result of the subtraction of two items?

    Hello,
    I'm new to this program, yet I am acquainted with him and some days I'm trying to figure out how to view the remaining space on the Synology NAS drive. I have solved connection via SNMP and disk capacity use hrStorageSize, for disk full hrStorageUsed. Now I would like to perform hrStorageSize - hrStorageUsed = FreeSpace that I'd like to see in the monitoring.
    Now I can only display both items and in my head I have to calculate vacancy.

    Trigger
    Name: Free disk space in {HOST.NAME} is below $3% (Used {ITEM.LASTVALUE1} from {ITEM.LASTVALUE2})

    Expression: 100 - (({nas2.interflag.local:hrStorageUsed.last(0)} / {nas2.interflag.local:hrStorageSize.last(0)}) * 100) < 15


    You advise me whether the calculated result is something to show Trigger Name?

    Thanks

    Ales

    PS: I would make sure that my question is understood, or really not my requirement solution?

    Sorry for my English, I not control it and I write only with the help of Google Translator
    Last edited by Ales Ulrych; 10-12-2016, 23:44. Reason: supplementing
  • Ales Ulrych
    Member
    • Dec 2016
    • 36

    #2
    Nobody knows?

    Nobody knows the answer or can not Zabbix do this?

    Comment

    • DmitryL
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • May 2016
      • 278

      #3
      Hello Ales,

      You might use calculated item, to calculate ( total - used ) and then create trigger on calculated item.

      Comment

      • Ales Ulrych
        Member
        • Dec 2016
        • 36

        #4
        Originally posted by Dmitryb
        Hello Ales,

        You might use calculated item, to calculate ( total - used ) and then create trigger on calculated item.
        https://www.zabbix.com/documentation...pes/calculated
        Thanks for the link,
        This is what I've read, and I did some tests, but I'm not working.
        Can you please send me a piece of code, how would you do in my job you applied?

        Comment

        • DmitryL
          Senior Member
          Zabbix Certified SpecialistZabbix Certified Professional
          • May 2016
          • 278

          #5
          If you have 2 SNMP items (1 for total and 1 for used)
          last("exact_key_from_item_total")-last("exact_key_from_item_used")

          This expression is Formula, not the item key.

          So basically you need 2 SNMP type keys, lets say
          key1 - to get total disk space using SNMP
          key2 - to get used disk space using SNMP

          Then create calculated item on same host and in formula field add expression:
          last("key1")-last("key2")

          Comment

          • Linwood
            Senior Member
            • Dec 2013
            • 398

            #6
            And on many systems you need to get the units of the first two as a third item as SNMP might not return bytes or megabytes. If all you want is percentages it doesn't matter, but if you want actual space you might need this. Check your MIB.

            Comment

            • Ales Ulrych
              Member
              • Dec 2016
              • 36

              #7
              Originally posted by Linwood
              And on many systems you need to get the units of the first two as a third item as SNMP might not return bytes or megabytes. If all you want is percentages it doesn't matter, but if you want actual space you might need this. Check your MIB.
              I know that I've already solved
              Last edited by Ales Ulrych; 24-02-2017, 13:18.

              Comment

              • Ales Ulrych
                Member
                • Dec 2016
                • 36

                #8
                Originally posted by Dmitryb
                If you have 2 SNMP items (1 for total and 1 for used)
                last("exact_key_from_item_total")-last("exact_key_from_item_used")

                This expression is Formula, not the item key.

                So basically you need 2 SNMP type keys, lets say
                key1 - to get total disk space using SNMP
                key2 - to get used disk space using SNMP

                Then create calculated item on same host and in formula field add expression:
                last("key1")-last("key2")
                Thanks, I get it working.

                Comment

                Working...