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

Action

Scheduled Pinned Locked Moved Development
11 Posts 2 Posters 47.2k 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.
  • V
    V
    Victor Kirhenshtein
    wrote on last edited by
    #2

    Hi,

    no you cannot get data from action. You can pass arguments to action - in server configuration you specify them separated by spaces (like in normal command line). When action is called, String[] args will contain those arguments. Boolean return value is to indicate if action was executed successfully.

    Best regards,
    Victor

    1 Reply Last reply
    0
    • P
      P
      pouya.moradian
      wrote on last edited by
      #3

      Hi,

      Thanks for your reply,

      I defined action in object tool, is it right? because i saw an action configuration in configuration menu strip.
      Also i used {DeviceActionName arg1 arg2} in agent's command field in object tool but on execute i got : Cannot execute action on node {NodeName}: Communication failure

      With Best Regards
      Pouya

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

        Hi,

        did you define action correctly in subagent? Can you show code registering your action?

        Best regards,
        Victor

        1 Reply Last reply
        0
        • P
          P
          pouya.moradian
          wrote on last edited by
          #5

          Hi,

          Here is my action code in some class that extends the Plugin, the other part of code are same as the sample code in  ..\netxms-snapshot-develop\src\agent\subagents\java\sample
          All of my parameters and  actions work fine in this class but passing parameter to actions is not possible and the action.txt file only contain "Action has been executed" !

          Thanks


          Action.png

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

            Code seems to be correct. Try to check with nxget that action was registered:

            nxget -l agent_ip_addr Agent.ActionList

            Also, make sure you are using correct action name in object tool. You can also execute agent action from command line using nxaction command.

            Best regards,
            Victor

            1 Reply Last reply
            0
            • P
              P
              pouya.moradian
              wrote on last edited by
              #7

              The Action is already registered (as it name appear in node's supported action list),
              but there is no nxaction binary fine in ..\NetXMS\bin in client side !
              I'm using 2.0 RC 1 agent.

              With best regards,
              Pouya

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

                Hi,

                nxaction is a server side tool.

                Best regards,
                Victor

                1 Reply Last reply
                0
                • P
                  P
                  pouya.moradian
                  wrote on last edited by
                  #9

                  Hi

                  You're right that's server side, And i can see my action is registered here !

                  [root@netxmslinux bin]# nxget -l 192.168.11.84 Agent.ActionList
                  Agent.Restart 2 "CORE"
                  System.Restart 2 "WinNT"
                  System.Shutdown 2 "WinNT"
                  DeviceLogAction 2 "JAVA"

                  Each time i use nxaction some error occur : Required argument(s) missing.
                  Can i have some example for using nxaction ?

                  My command is :
                  nxaction DeviceLogAction -a 'none' -e 0 -K /usr/local/var/lib/netxms/.server_key -p 4700 -w 5 -W 30

                  I Also tried to check each one of these option by removing them,
                  and it does not work.

                  Thanks for your reply,
                  Pouya

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

                    You have to specify agent address in command line as well (before action name).

                    Best regards,
                    Victor

                    1 Reply Last reply
                    0
                    • P
                      P
                      pouya.moradian
                      wrote on last edited by
                      #11

                      Hi

                      Thanks a lot, it works fine.
                      the full format of action execution command is like:

                      nxaction NodeIP ActionName ParameterHere  -a 'none' -e 0 -K /usr/local/var//lib/netxms/.server_key -p 4700 -w 10 -W 30

                      it may help someone else.

                      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