Ad Widget

Collapse

calculated Item in SNMP template

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ali136
    Junior Member
    • Oct 2018
    • 13

    #1

    calculated Item in SNMP template

    Hello everybody,
    I have a scenario which drives me crazy.
    let's suppose I have a device with 4 ethernet interfaces.
    I need to to have one calculated item to know the sum of inbound traffic.
    I googled it everywhere users said you should do something like this:
    last({TEMPL_NAME:KEY_OF_OIDA})/last({TEMPL_NAME:KEY_OF_OIDB})
    my problem is that Key is the same for all of the interfaces and I have one item prototype
    can anyone tell how to do it? there are more than 1000 host monitored, so I have to do it using a template.
    Thanks in advance
  • kloczek
    Senior Member
    • Jun 2006
    • 1771

    #2
    If you need a sum why you are using division?
    http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
    https://kloczek.wordpress.com/
    zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
    My zabbix templates https://github.com/kloczek/zabbix-templates

    Comment

    • ali136
      Junior Member
      • Oct 2018
      • 13

      #3
      I replied yesterday but it's not posted yet.
      what I said, I meant I need two keys to do the calculation, and it was based on assumption.
      what I really need is data-rate on wireless devices
      each card has two chains each chain datarate for RX and TX
      so I will have TX-vertical TX-horizontal and I need the sum of both TXs and both RXs
      here is what I did so far:
      Click image for larger version

Name:	Screenshot from 2018-10-10 12-39-48.png
Views:	2015
Size:	233.4 KB
ID:	367008
      then created Item prototype
      Click image for larger version

Name:	Screenshot from 2018-10-10 12-40-27.png
Views:	1910
Size:	173.5 KB
ID:	367007

      so far everything is ok
      Click image for larger version

Name:	Screenshot from 2018-10-10 12-41-12.png
Views:	1701
Size:	10.3 KB
ID:	367006
      now what I need is the sum of above Items

      thanks in advanced

      Comment

      • kloczek
        Senior Member
        • Jun 2006
        • 1771

        #4
        Something like data rate is calculated by zabbix automatically (item page -> Preprocessing tab -> Add -> in Name drop down list you have Simple change and Change per second).
        In other words you don't need to use calculated item type.
        http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
        https://kloczek.wordpress.com/
        zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
        My zabbix templates https://github.com/kloczek/zabbix-templates

        Comment

        • ali136
          Junior Member
          • Oct 2018
          • 13

          #5
          I could not find the processing tab, neither in discovery nor in the host itself. I'm using version 3.2
          but that is not my problem
          for each host I will have 4 Items, as below:
          I added values to make more sense.
          RX vertical : 350
          RX horizontal : 350
          TX vertical :200
          TX horizontal 100
          now what I need is
          RX : 700
          TX : 300
          I already have datarate per second with no problem

          Click image for larger version

Name:	Screenshot from 2018-10-11 10-43-42.png
Views:	1077
Size:	88.8 KB
ID:	367027

          Thanks.

          Comment

          • ali136
            Junior Member
            • Oct 2018
            • 13

            #6
            Any help ?

            Comment

            • ali136
              Junior Member
              • Oct 2018
              • 13

              #7
              no one answered

              lets put it this way and I tell you another problem that I've faced.
              I have a device which has 36 cores of CPU, I got each core usage as an Item, now I want to calculate the average
              in order to do this I should somehow be able to say:
              sum(all-Items)/core-count.
              I know the format that I wrote is not gonna work. I'm looking for the correct one.
              Device SNMP does not support load-average or something like that.
              thanks in advance.

              Comment

              • kloczek
                Senior Member
                • Jun 2006
                • 1771

                #8
                You just started new thread,
                You don't need to sample CPU usage per core and than calculate avg because system.cpu.util[.<type>,] automatically gives you what you want (default this key gives avg in last 1min).
                https://www.zabbix.com/documentation...s/zabbix_agent.
                About you prev topic: you cannot have one metric on horizontal ax and another on vertical one because all metrics are on time scale (horizontal).
                And generally .. I've lost what you really want to implement (and this is only reason that no one answered).
                http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
                https://kloczek.wordpress.com/
                zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
                My zabbix templates https://github.com/kloczek/zabbix-templates

                Comment

                • ali136
                  Junior Member
                  • Oct 2018
                  • 13

                  #9
                  Hi
                  thank you klocdek
                  using Zabbix agent would be a good idea if the device supports it, but unfortunately, I have to use SNMP. If I have answer for this question I will figure out the other question
                  thanks in advance.

                  Comment

                  • ali136
                    Junior Member
                    • Oct 2018
                    • 13

                    #10
                    About you prev topic: you cannot have one metric on horizontal ax and another on vertical one because all metrics are on time scale (horizontal).
                    its two streams of data, just like having two wireless cards except it is one card. I mean you can assume I have 200M in one card and 100M in another card and I need calculation. it is called polarization (vertical, horizontal) in wireless.
                    If you look at my questions they are quite straightforward.

                    calculating the sum of 4 ethernet incoming.
                    calculating the sum of 2 streams of data in a wireless card.
                    calculating the sum of 36 cores of CPU to have the average.

                    All I need is to calculate similar items. that's all.
                    In all cases that I opened its the same problem.
                    If it is not possible just tell me. otherwise, please help me.

                    Thanks indeed.

                    Comment

                    • ali136
                      Junior Member
                      • Oct 2018
                      • 13

                      #11
                      It seems no one here knows how to solve this problem.

                      Comment

                      • ali136
                        Junior Member
                        • Oct 2018
                        • 13

                        #12
                        I can even pay for someone who can give me the solution. I really need this to work.

                        Comment

                        Working...