Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse
Brand Logo

NetXMS Forum

  1. Home
  2. Support
  3. ServiceCheck.Custom parameters?

ServiceCheck.Custom parameters?

Scheduled Pinned Locked Moved Support
5 Posts 2 Posters 33.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T
    T
    tedv
    wrote on last edited by
    #1

    Hi, I'm trying to monitor from a node if it can reach a TCP port on another machine.

    The ServiceCheck.Custom appears to be the most logical data collection item.

    However, I can't find a description of the parameters

    What would be the parameters to check if for example port 8080 gives a response on IP  10.1.2.3 (it's not HTTP)

    Thanks,
    Ted

    1 Reply Last reply
    0
    • V
      V
      Victor Kirhenshtein
      wrote on last edited by
      #2

      Hi!

      ServiceCheck.Custom accepts two arguments - host name or IP address and port number. For example, to check port 8080 on address 10.1.2.3, use

      ServiceCheck.Custom(10.1.2.3,8080)

      All ServiceCheck.* parameters return the following values:

      0 - success (server was connected and return expected response);
      1 - invalid arguments was passed;
      2 - cannot connect to server;
      3 - bad server's response.

      Best regards,
      Victor

      1 Reply Last reply
      0
      • T
        T
        tedv
        wrote on last edited by
        #3

        @victor said in ServiceCheck.Custom parameters?:

        Hi!

        ServiceCheck.Custom accepts two arguments - host name or IP address and port number. For example, to check port 8080 on address 10.1.2.3, use

        ServiceCheck.Custom(10.1.2.3,8080)

        All ServiceCheck.* parameters return the following values:

        0 - success (server was connected and return expected response);
        1 - invalid arguments was passed;
        2 - cannot connect to server;
        3 - bad server's response.

        Best regards,
        Victor

        Thanks Victor - that works.
        However, when I (for testing purposed) make sure that the node can't reach the other host, the value of the DCI doesn't change, it just does not get updated anymore. So, I can't put a threshold on it?

        Example

        My data collection does ServiceCheck.Custom(10.1.2.3,8080) - that gives 0 as response every 30 seconds (the interval).

        When I trick the machine that it can't reach the other host (10.1.2.3), the value stays at 0 and the timestamp isn't updated.

        Any suggestions?

        Thanks,
        Ted

        1 Reply Last reply
        0
        • V
          V
          Victor Kirhenshtein
          wrote on last edited by
          #4

          Most likely the problem is that default timeout for receiving data from agent is smaller then default connection timeout. I suggest to set connection timeout in port check subagent to some small value, and increase agent response timeout on server.

          For example, to set agent response timeout to 5 seconds and connect timeout in port checker to 4 seconds, do the following:

          Set server configuration variable AgentCommandTimeout to 5000;
          Add the following to nxagentd.conf on node with port checker:

          *portCheck
          Timeout = 4000

          Best regards,
          Victor

          1 Reply Last reply
          0
          • T
            T
            tedv
            wrote on last edited by
            #5

            Thanks, that works. Now I'm getting a 2 for status as expected.

            1 Reply Last reply
            0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            Powered by NodeBB Contributors
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups