Scheduled Task: Execute.Action?

Started by Hanfelt, September 05, 2022, 06:24:53 PM

Previous topic - Next topic

Hanfelt

Can someone describe this one for me i cannot understand how it works or what it is supposed to call. I thought i would be able to call an action i agent conf or an object tool action...

Filipp Sudanov

Yes, it's possible to call action when some event happens (from Event Processing Policy). And it's possible to run agent action from Object Tool (there it's currently called Agent Command).
Can you give more details on what you want to configure and we will go through the process.

Hanfelt

I was wondering what the Execute Action under Scheduled task can do?

Alex Kirhenshtein

You can execute any action which is provided by the ageng (e.g. System.Restart). Also you need to select target object (where action will be executed).

List of actions can be queried from the agent, either with "nxget -l AGENT_IP Agent.ActionList" or in the GUI - right click on the node, then select Tools -> Info->Agent->Supported actions

Hanfelt

Thanks for the input, this is how i thought it was working but i didnt know about the agent action list poll.

Im still having trouble running it from the scheduled task though. If i turn on debug 4 on server i get this error log:

[action            ] Cannot execute scheduled action on node [103]: original event is unavailable

if i run the action on the node from the netxms server cmd it works
.\nxaction.exe ip test
Action executed successfully

Hanfelt

I made a workaround instead created a script called RunAction:

AgentExecuteAction($node, $1);

This one takes a parameter so in Scheduled Task you should select Execute.Script instead and in parameters put
RunAction(NameOfActionInAgentConf)