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. AgentExecuteAction

AgentExecuteAction

Scheduled Pinned Locked Moved Support
3 Posts 2 Posters 17.7k 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.
  • B
    B
    BigBlue
    wrote on last edited by
    #1

    Hello,

    I am trying to use the NXSL command "AgentExecuteAction".

    In the configuration file of my agent, I have placed:

    ExternalParameter = Test:echo test > /tmp/test.txt
    

    This works very well on the command line:

    /opt/netxms/bin/nxget localhost 'Test
    
    # more /tmp/test.txt
    test
    

    So, I made a very small script  ;):

    AgentExecuteAction($node, "Test");
    

    I execute it...
    I can see the action in debug mode:

      ** code=0x0043 (CMD_ACTION) version=5 flags=0x0000 id=4 size=56 numFields=3
      ** 000000: [    87] UTF8-STRING "Test"
      ** 000010: [   482] INT16       0
      ** 000018: [    88] INT32       0
    
    2021.06.07 16:22:52.231 *D* [comm.cs.4          ] Received message CMD_ACTION (4)
    2021.06.07 16:22:52.231 *D* [actions            ] ExecuteAction(Test): requestId=4, RCC=404
    2021.06.07 16:22:52.231 *D* [comm.cs.4          ] Sending message CMD_REQUEST_COMPLETED (ID 4; size 32; uncompressed)
    2021.06.07 16:22:52.231 *D* [comm.cs.4          ] Outgoing message dump:
      ** 000000 | 00 1D 50 00 00 00 00 20 00 00 00 04 00 00 00 01 | ..P.... ........
      ** 000010 | 00 00 00 1C 00 00 00 00 00 00 01 94 00 00 00 00 | ................
      ** code=0x001D (CMD_REQUEST_COMPLETED) version=5 flags=0x0000 id=4 size=32 numFields=1
      ** 000000: [    28] INT32       404
    
    2021.06.07 16:22:52.231 *D* [comm.cs.4          ] Communication channel closed by peer
    2021.06.07 16:22:52.231 *D* [comm.cs.4          ] Session with 129.20.128.4 closed
    2021.06.07 16:22:52.231 *D* [comm.cs.4          ] Session unregistered
    2021.06.07 16:22:52.231 *D* [comm.cs.4          ] Receiver thread stopped
    

    but it doesn't work ...

    Is it a syntax problem?
    A Parameter problem?

    Thanks
    BB

    1 Reply Last reply
    0
    • F
      F
      Filipp Sudanov
      wrote on last edited by
      #2

      There are two things that can be configured on agent:

      • ExternalParameter (gets executed when server or nxget is requesting the value from agent. Or with AgentReadParameter() from NXSL)
      • ExternalAction (gets executed by nxaction, server action (e.g. from EPP rule) or NXSL AgentExecuteAction
      1 Reply Last reply
      0
      • B
        B
        BigBlue
        wrote on last edited by
        #3

        With AgentReadParameter it is perfect.
        Thank you.

        BB

        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