Ad Widget

Collapse

Help Item

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Thomas51
    Junior Member
    • Oct 2024
    • 19

    #1

    Help Item

    Hello,

    I am trying to obtain the maximum measured time for a round trip. I saw that I need to use a calculated item. Here is the configuration:

    Key: tcp.rtt.max
    Formula: max("net.tcp.service.perf[tcp,80]", 300)

    I am getting the error:
    Cannot evaluate expression: function argument "net.tcp.service.perf[tcp,80], 300" is not a numeric value at "max("net.tcp.service.perf[tcp,80], 300)".

    Can you help me?
  • Hamardaban
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • May 2019
    • 2713

    #2
    max(/host/net.tcp.service.perf[tcp,80], 300)

    Comment

    • Thomas51
      Junior Member
      • Oct 2024
      • 19

      #3
      Hello,

      Thank you, I tried to execute the command, but I got the error: "Cannot evaluate function: item '/host/net.tcp.service.perf[tcp,80]' does not exist at 'max(/host/net.tcp.service.perf[tcp,80], 300)'."

      Do I need to add other parameters ?

      Comment

      • Thomas51
        Junior Member
        • Oct 2024
        • 19

        #4
        Here is the screenshot :

        Click image for larger version

Name:	Capture.png
Views:	172
Size:	46.9 KB
ID:	493241

        Comment

        • Hamardaban
          Senior Member
          Zabbix Certified SpecialistZabbix Certified Professional
          • May 2019
          • 2713

          #5
          RTFM !!!!
          /host/ - means the name of the host on which the data element exists "/test-ansimble3/net.tcp......."
          if the formula is created on the same host, you can skip the hostname and write "//net.tcp......."

          Comment

          • Thomas51
            Junior Member
            • Oct 2024
            • 19

            #6
            Sorry, I didn't see the link. Is it possible to use something like {HOST.NAME} to avoid creating an item for each machine? I tried using it without success

            Comment

            • cyber
              Senior Member
              Zabbix Certified SpecialistZabbix Certified Professional
              • Dec 2006
              • 4807

              #7
              Originally posted by Thomas51
              Sorry, I didn't see the link. Is it possible to use something like {HOST.NAME} to avoid creating an item for each machine? I tried using it without success
              thats why templates are there...make once, apply to several...

              Comment

              • Thomas51
                Junior Member
                • Oct 2024
                • 19

                #8
                Yes, that's what I did, but I can't manage to reproduce it as a template

                Comment

                • ISiroshtan
                  Senior Member
                  • Nov 2019
                  • 324

                  #9
                  It was already noted above, the "/test-ansimble3/net.tcp...." version would be taking data from specifically hardcoded host, no matter on which host you create this item. But if you want for item to calculate the value from data on the same host where item created use "//net.tcp...." version.

                  Examples:
                  Lets say you have host Test1.
                  You add calculated item on host Test1 with formula "/Test1/net.tcp...." - it will be taking data from Host1
                  You add another item on host Test1 with formula "//net.tcp...." - it will also be taking data from Host1

                  Now you create host named Test2
                  You add calculated item on host Test2 with formula "/Test1/net.tcp...." - it will be taking data from Host1!
                  You add another item on host Test2 with formula "/Test2/net.tcp...." - it will be taking data from Host2!
                  ​​You add another item on host Test2 with formula "//net.tcp...." - it will be taking data from Host2(!!!)

                  You add another host named Test3
                  ​​You add another item on host Test3 with formula "//net.tcp...." - it will be taking data from Host3(!!!)

                  Comment


                  • Thomas51
                    Thomas51 commented
                    Editing a comment
                    Thank you for the response. I’m getting the following error: Invalid parameter '/1/params': incorrect expression starting from 'max(//net.tcp.service.perf[tcp,,80],10m
                • ISiroshtan
                  Senior Member
                  • Nov 2019
                  • 324

                  #10
                  Thomas51 could you attach screenshots of both item you trying to use as basis for calculated item and screenshot of error (with item params visible) when creating the new calculated item.
                  Also kindly mention exact Zabbix version in use.
                  Last edited by ISiroshtan; 27-10-2024, 16:50.

                  Comment


                  • Thomas51
                    Thomas51 commented
                    Editing a comment
                    I’m using Zabbix 6.4
                • Thomas51
                  Junior Member
                  • Oct 2024
                  • 19

                  #11
                  Here is the screenshot;
                  Attached Files
                  Last edited by Thomas51; 28-10-2024, 15:51.

                  Comment

                  • ISiroshtan
                    Senior Member
                    • Nov 2019
                    • 324

                    #12
                    Tried to add similar item in my 6.4 and all went fine. Can you also show me the screenshot of existing item with key net.tcp.service.perf[tcp,,80],10m) ?

                    Comment


                    • Thomas51
                      Thomas51 commented
                      Editing a comment
                      I updated the server, and that resolved the issue tranks
                  Working...