Ad Widget

Collapse

Simple TCP check not working?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Nomadic1
    Junior Member
    • Jan 2022
    • 1

    #1

    Simple TCP check not working?

    Hello,

    I haven't used Zabbix in a while, and while reading the docs this should work:

    Zabbix versions: 5.0 LTS
    Macro: HOMEASSISTANT_PORT = 8123
    Check: Zabbix Agent (active)
    zabbix_agentd -t 'net.tcp.port[,8123]'

    But when i add it as a item like this it says 'invalid second parameter'

    net.tcp.port[,{$HOMEASSISTANT_PORT}]

    What am i missing?
  • Mbar
    Junior Member
    • Jan 2022
    • 10

    #2
    I think you are using an invalid key. I don't see net.tcp.port in the documentation.

    What you probably want to do is:

    net.tcp.service[service,<ip>,<port>]

    so in your case:

    net.tcp.service[tcp,,{$HOMEASSISTANT_PORT}]

    The documentation says the 'tcp' option in the first parameter will simply connect to the port without doing any checking beyond that.
    If you just want to check the port is open on the host computer that would be the one to use.


    Reference:



    Comment

    • icol
      Member
      • Aug 2014
      • 31

      #3
      Why do you have the coma, there is no coma in the documentation: https://www.zabbix.com/documentation...s/zabbix_agent

      Comment

      • Mbar
        Junior Member
        • Jan 2022
        • 10

        #4
        Based on the agent documentation it should be working.

        Example:
        => net.tcp.port[,80] → can be used to test the availability of a web server running on port 80.

        The issue could be in your agent configuration file or something to do with the version of the agent software.

        Do you have an entry for net.tcp.port in your agent configuration?

        What is the version of your agent?



        Comment

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

          #5
          Absolutely no issues when adding an item with a key "net.tcp.port[,{$HOMEASSISTANT_PORT}]". Not in 4.4, not in 5.0...Taken from this thread with copy-paste...

          Comment

          Working...