Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse
Brand Logo

NetXMS Forum

  1. Home
  2. Support
  3. ActionShellExec it doesnt works with agent configuration Policy

ActionShellExec it doesnt works with agent configuration Policy

Scheduled Pinned Locked Moved Support
4 Posts 2 Posters 28.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L
    L
    Luis Montaño
    wrote on last edited by
    #1

    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 file

    It 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

    1 Reply Last reply
    0
    • V
      V
      Victor Kirhenshtein
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • L
        L
        Luis Montaño
        wrote on last edited by
        #3

        Thanks Victor, it works perfectly.
        ¿Is there a way to automaticaly restart agent after a policy change?

        1 Reply Last reply
        0
        • V
          V
          Victor Kirhenshtein
          wrote on last edited by
          #4

          Currently no. We have a feature request for that.

          Best regards,
          Victor

          1 Reply Last reply
          0

          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
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          Powered by NodeBB Contributors
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups