Execute command on remote node via agent
-
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 1And in Configuration->Actions Configuration ->
Name : agentscript1
type : Execute command on remote node via agent
Remote host : %a
Agent's action: script1when 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 ??
-
-
Hi,
try to use ActionShellExec instead of Action in nxagentd.conf.
Best regards,
Victor -
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