Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - vlad.fratila

#1
General Support / Agent Actions parameters not working
September 02, 2014, 01:06:48 PM
I am trying to call an action from an agent with a parameter. I defined the action in the agent's config file like this:

ActionShellExec = Echo: /tmp/script.sh $1
The script only echo's it's first parameter to a file.

I am trying to call the action from an Action Object Tool.
If I define "Agent's Action" as: Echo, it works and I get in agent's log file with debug level 9 the following:

[02-Sep-2014 09:48:19.708] [DEBUG] [session:1] Message dump:
  ** 00430000000000380000000200000002
  ** 00000057010000000000000800450063
  ** 0068006F6E205B3200000058007FF229
  ** 0000000000000000
  ** code=0x0043 (CMD_ACTION) flags=0x0000 id=2 size=56 numFields=2
  ** [    87] STRING "Echo"
  ** [    88] INT32  0

[02-Sep-2014 09:48:19.708] [DEBUG] [session:1] Received message CMD_ACTION
[02-Sep-2014 09:48:19.708] [DEBUG] Executing action Echo of type 3
[02-Sep-2014 09:48:19.708] [DEBUG] SH_EXEC: Expanding command "/tmp/script.sh"
[02-Sep-2014 09:48:19.708] [DEBUG] SH_EXEC: Executing "/tmp/script.sh"
[02-Sep-2014 09:48:19.714] [DEBUG] [session:1] Sending message CMD_REQUEST_COMPLETED (size 32)
[02-Sep-2014 09:48:19.715] [DEBUG] [session:1] Session with 10.20.1.7 closed


But if I define "Agent's Action" as: Echo parameter1, it fails with a communication failure.
The log looks like this:

[02-Sep-2014 09:51:59.670] [DEBUG] [session:1] Message dump:
  ** 00430000000000500000000200000002
  ** 00000057010000000000001E00450063
  ** 0068006F00200070006100720061006D
  ** 0065007400650072003100004C000000
  ** 00000058007F00000000000041006700
  ** code=0x0043 (CMD_ACTION) flags=0x0000 id=2 size=80 numFields=2
  ** [    87] STRING "Echo parameter1"
  ** [    88] INT32  0

[02-Sep-2014 09:51:59.670] [DEBUG] [session:1] Received message CMD_ACTION
[02-Sep-2014 09:51:59.670] [DEBUG] [session:1] Sending message CMD_REQUEST_COMPLETED (size 32)
[02-Sep-2014 09:51:59.671] [DEBUG] [session:1] Session with 10.20.1.7 closed


This happens in version 1.2.14 and 1.2.16 also.

Thank you,
Vlad
#2
General Support / Output of agent action
August 13, 2014, 04:36:24 PM
I defined an action in an agent's config file. Something like:

Action = test_action: /bin/echo "hello"

Is there a way to define an Object Tool that will call this action, and also have the output of the action displayed in the NetXMS management interface?