Action
-
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 -
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 failureWith Best Regards
Pouya -
Hi,
did you define action correctly in subagent? Can you show code registering your action?
Best regards,
Victor -
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

-
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 -
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 -
Hi,
nxaction is a server side tool.
Best regards,
Victor -
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 30I Also tried to check each one of these option by removing them,
and it does not work.Thanks for your reply,
Pouya -
You have to specify agent address in command line as well (before action name).
Best regards,
Victor -
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.
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