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. Execute command on remote node via agent

Execute command on remote node via agent

Scheduled Pinned Locked Moved Support
4 Posts 2 Posters 37.6k 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
    tholle
    wrote on last edited by
    #1

    Hi,

    And thanks for a great product .. it has resolved a lot of problems for us 🙂

    but ... i can't get remote script working on event..

    I made a action on the agent ... nxagentd.conf
    EnableActions=yes
    Action=script1:/bin/ls -l > /tmp/script1.txt && echo 1

    And in Configuration->Actions Configuration ->
    Name : agentscript1
    type : Execute command on remote node via agent
    Remote host : %a
    Agent's action: script1

    when i add a Event processing Policy before the "Generate alarm on threshold violation" as a copy of that .. remove the "create new" to "Do not change alarms" .. and add "Server Acrions" -> Action = agentscript1 ...

    when i stress the agent pc i can se the agent log receive the action request fine ..

    Connection from 192.168.1.29 accepted
    [18-Apr-2016 22:17:46.975] [DEBUG] [session:1] Received control message CMD_GET_NXCP_CAPS
    [18-Apr-2016 22:17:46.975] [DEBUG] [session:1] Sending message CMD_NXCP_CAPS (size 16)
    [18-Apr-2016 22:17:46.986] [DEBUG] [session:1] Received message CMD_SET_SERVER_CAPABILITIES
    [18-Apr-2016 22:17:46.986] [DEBUG] [session:1] Sending message CMD_REQUEST_COMPLETED (size 32)
    [18-Apr-2016 22:17:46.997] [DEBUG] [session:1] Received message CMD_ACTION
    [18-Apr-2016 22:17:46.997] [DEBUG] Executing action script1 of type 1
    [18-Apr-2016 22:17:46.997] [DEBUG] EXEC: Expanding command "/bin/ls -l > /tmp/script1.txt && echo 1"
    [18-Apr-2016 22:17:46.997] [DEBUG] EXEC: Executing "/bin/ls -l > /tmp/script1.txt && echo 1"
    [18-Apr-2016 22:17:47.008] [DEBUG] [session:1] Sending message CMD_REQUEST_COMPLETED (size 32)
    [18-Apr-2016 22:17:47.019] [DEBUG] [session:1] Message receiving error (MSGRECV_CLOSED)
    [18-Apr-2016 22:17:47.019] [DEBUG] [session:1] Session with 192.168.1.29 closed
    [18-Apr-2016 22:17:56.961] [DEBUG] [session:0] Received message CMD_GET_PARAMETER
    [18-Apr-2016 22:17:56.961] [DEBUG] [session:0] Requesting parameter "System.CPU.LoadAvg"
    [18-Apr-2016 22:17:56.961] [DEBUG] [session:0] Sending message CMD_REQUEST_COMPLETED (size 64)

    but nothing happend !! .. no /tmp/script1.txt files ...

    i had try to add the actions in "Object tools" and i works fine there ..

    any help ??

    1 Reply Last reply
    0
    • T
      T
      tholle
      wrote on last edited by
      #2

      ups ... i use ver 2.03 on centos servers .. both on netxms server and agent server 🙂

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

        Hi,

        try to use ActionShellExec instead of Action in nxagentd.conf.

        Best regards,
        Victor

        1 Reply Last reply
        0
        • T
          T
          tholle
          wrote on last edited by
          #4

          Bingo ... it works ... thanks a lot ..

          sometimes .. when you get the answar .. the question look so silly 🙂

          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