ActionShellExec it doesnt works with agent configuration Policy
-
Hi,
I'm using ActionShellExec option in the configuration file to execute a command on a remote host.
I have the following is my configuration file:##############################################################config file
MasterServers = CPRG-MRED
ConfigIncludeDir = C:\NetXMS\etc\nxagentd.conf.d
LogFile = {syslog}
FileStore = C:\NetXMS\var
SubAgent = ecs.nsm
SubAgent = filemgr.nsm
SubAgent = ping.nsm
SubAgent = logwatch.nsm
SubAgent = portcheck.nsm
SubAgent = winperf.nsm
SubAgent = wmi.nsm
ActionShellExec=DisplayServices:wmic service get DisplayName,name,startname
##############################################################config fileIt works fine , but the problem is when I configure that option in a policy :
<config>
<agent>
<!-- there can be added comment -->
<MasterServers>X.X.X.X</MasterServers>
<ConfigIncludeDir>C:\NetXMS\etc\nxagentd.conf.d</ConfigIncludeDir>
<FileStore>C:\NetXMS\var</FileStore>
<LogFile>{syslog}</LogFile>
###################################### INI SUBAGENTES
<SubAgent>ecs.nsm</SubAgent>
<SubAgent>filemgr.nsm</SubAgent>
<SubAgent>ping.nsm</SubAgent>
<SubAgent>logwatch.nsm</SubAgent>
<SubAgent>portcheck.nsm</SubAgent>
<SubAgent>winperf.nsm</SubAgent>
<SubAgent>wmi.nsm</SubAgent>
<SubAgent>ssh.nsm</SubAgent>
<SubAgent>netsvc.nsm</SubAgent>
<SubAgent>dbquery.nsm</SubAgent>
###################################### FIN SUBAGENTES<ActionShellExec>DisplayServices:wmic service get DisplayName,name,startname</ActionShellExec>
</agent>
<filemgr>
<RootFolder>C:\</RootFolder> # read/write access
<RootFolder>D:\</RootFolder> # read/write access
</filemgr><WinPerf>
<EnableDefaultCounters>yes</EnableDefaultCounters>
</WinPerf>
</config>It doesnt works anymore and I get an error: Cannot execute action on node CPRG-MCFE: Communication failure
-
Hi,
replace <agent> tag with <core>. Also, it is not mandatory to use XMS format in policy - you can use same key=value format as in nxagentd.conf.
Best regards,
Victor -
Thanks Victor, it works perfectly.
¿Is there a way to automaticaly restart agent after a policy change? -
Currently no. We have a feature request for that.
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