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. Development
  3. SSH.Command with different port

SSH.Command with different port

Scheduled Pinned Locked Moved Development
5 Posts 2 Posters 45.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.
  • P
    P
    pvo
    wrote on last edited by
    #1

    I've seen that that the SSH.Command uses fixed port 22.
    It would be useful to have the possibility to specify different port. Can I add the fifth optional parameter port with default value 22 to the SSH.Command? Would you add it this change to your sources?

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

      Hi,

      port can be specified as part of host name after : character. This is relevant piece of code from SSH subagent: https://github.com/netxms/netxms/blob/819a9418773ce2fe4b5589397a70716d736c652e/src/agent/subagents/ssh/handlers.cpp#L39

      Best regards,
      Victor

      1 Reply Last reply
      0
      • P
        P
        pvo
        wrote on last edited by
        #3

        Hi Victor,

        thank you for your answer. It was good idea first ask before I startedĀ  to modify the sourcesĀ  ;).

        If I understand this right, there is no such posibility for the NXSL function executeSSHCommand. Is it so?

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

          Yes, that's actually a problem - executeSSHCommand uses SSH settings from node it is called on, and it is actually not possible to set SSH port for node.
          In NXSL workaround is to use agentReadList - all that executeSSHCommand does is reading agent list with necessary arguments (properly escaped). But it has to be fixed anyway - SSH port for node definitely should be configurable, and maybe optional port number, login, and password arguments can be added to executeSSHCommand.

          Best regards,
          Victor

          1 Reply Last reply
          0
          • P
            P
            pvo
            wrote on last edited by
            #5

            Thank you.
            I know this workaround.

            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