NetXMS Support Forum

English Support => General Support => Topic started by: MartinR on June 26, 2013, 09:43:55 PM

Title: Agent's action will be ignored [SOLVED]
Post by: MartinR on June 26, 2013, 09:43:55 PM
Hi there, after hours of googling I hope to get help here.
I just want to execute a command on the agent's computer, but it still ignores it.
- I successfully configured an alarm with somehow action (send an E-mail).
- I additionally configured an Agent's action named 'shutthisdown' and configured it to the same alarm, which sends the email.
- examined the log file, but I can not find an entry about any command to execute.
Only wevtapi.dll was not found.

Here is the Agent config file:

--8<--
#
# NetXMS agent configuration file
# Created by agent installer at Tue Jun 25 10:47:56 2013
#

DebugLevel = 9
Controlservers = netxms.lorenz-messtechnik.local
MasterServers = netxms.lorenz-messtechnik.local
ConfigIncludeDir = C:\NetXMS\etc\nxagentd.conf.d
#LogFile = {syslog}
LogFile = C:\NetXMS\debuglog.txt
FileStore = C:\NetXMS\var
SubAgent = ecs.nsm
SubAgent = ping.nsm
SubAgent = logwatch.nsm
SubAgent = portcheck.nsm
SubAgent = winperf.nsm
# Action= shutthisdown:cmd.exe /c "shutdown /s /t 180 /f"
Action= shutthisdown:cmd.exe /c "dir c:\ > c:\1.txt"
SubAgent = wmi.nsm
SubAgent = ups.nsm

# UPS subagent configuration section
*UPS
Device = 0:"COM2:":APC
-->8--

Many thanks for your help

Martin
Title: Re: Agent's action will be ignored
Post by: MartinR on June 27, 2013, 09:44:49 AM
Oh, sorry.
I should tell you some versions:
Server and Agent are running in W2k3R2
I use the actual netxms version 1.2.7
The notification of the ups works fine on that agent.

Thank you for help.

Martin
Title: Re: Agent's action will be ignored
Post by: Victor Kirhenshtein on June 27, 2013, 11:55:31 AM
Can you please show the screenshots of action configuration on server and appropriate event policy rule? Also, can you try to execute action manually with nxaction command line tool?

Best regards,
Victor
Title: Re: Agent's action will be ignored
Post by: MartinR on June 27, 2013, 05:13:53 PM
Hi Victor,
action definition and processing rules are attached.
I defined two actions in this processing rule. The mail as second action will be sent as expected.
The shutdown initiated with the shutdown button of the Object Details View of the client works as expected, too.
nxaction command line tool executes the action correctly (as expected).
Thank you for your help.
Best Regards
Martin
Title: Re: Agent's action will be ignored
Post by: Victor Kirhenshtein on June 27, 2013, 05:38:55 PM
Hi!

You have an error in action configuration - you have to specify remote host where to execute an action. Usually you can use macro %a here to execute it on event source.

Best regards,
Victor
Title: Re: Agent's action will be ignored
Post by: MartinR on June 27, 2013, 06:16:15 PM
Hi,
I now tried different versions of the Agent's action line.

%a shutthisdown
<name_of_machine> shutthisdown
<IP-Address> shutthisdown
nxaction <name_of_machine> shutthisdown

I assumed that "Agent's action" means of course the agent that initiates the action.

Can you please give me an example for a line that executes a command on the agent that causes the action (maybe with %a or %n)? The penny has not dropped yet.
Thank you for your help.
Best Regards
Martin
Title: Re: Agent's action will be ignored
Post by: Victor Kirhenshtein on June 27, 2013, 10:16:30 PM
Hi!

You should put %a in "Remote Host" field and shutthisdown in "Agent action" field.

Best regards,
Victor
Title: Re: Agent's action will be ignored
Post by: MartinR on June 28, 2013, 10:28:53 AM
Hi,
now the penny dropped.
The agent reacts now as expected.

Thank you very much for your help

Best Regards
Martin