About GDMA with PMC

When you deploy Parent Managed Child servers, the Child can serve as the system where GDMA agents report their results. This is very useful in keeping the atomic many-to-one traffic inherent in agent based monitoring local to the network where the Child is deployed. However, in contrast to Child Managed Child configurations, Parent Managed Child servers can't serve as the point of configuration or auto-registration, or auto-setup for GDMA agents. This is because the database for all configurations these features depend upon is on the Parent, not the Child in this case. 

To allow you to have the GDMA use the Child as the Target Server and keep the GDMA > Server traffic local, you can proxy the requests for configuration externals, for auto-registration, and for auto-setup and plugin downloads to the Parent. This How To provides you the steps for setting this up. Note GroundWork may make this the default in future configurations. 

Configuring GDMA with PMC

  1. Go to the Child server command line as the gwos user, and change to the gw8 directory: 

    cd gw8
    CODE
  2. Enter the following to back up the configuration file you will be modifying:

    docker-compose exec revproxy cp /etc/nginx/local/common_server_config /etc/nginx/local/common_server_config.orig
    CODE
  3. Next, type the following to edit the file, which will result in a vi session: 

    docker-compose exec revproxy vi /etc/nginx/local/common_server_config
    CODE
  4. Go to line 211 (in an otherwise unmodified version), where you will see the start of a section defining the /gdma locations. You will need to remove these definitions down to the Monarch location at around line 258 (leave that in place):

    # Calls served by Monarch, such as:
    CODE
  5. Replace the definitions you removed with the following, changing out the myparentserver.example.com for your Parent servers DNS name (and make sure to :set paste in vi if pasting in vi)

    set $parent_protocol https;
    set $parent_server myparentserver.example.com;
    # Calls served by Monarch for GDMA, such as:
    # /gdma/gwmon_myhost.mydomain.com.cfg
    location ^~ /gdma/ {
        proxy_set_header Host              $parent_server;
        proxy_set_header Referer           $http_referer;
        proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Real-IP         $remote_addr;
        proxy_set_header Connection        "";
        proxy_pass $parent_protocol://$parent_server;
    }
    # Calls served by Monarch for GDMA Auto-Setup discovery instructions files, such as:
    # /gdma_instructions/myhostname_instructions
    location ^~ /gdma_instructions/ {
        proxy_set_header Host              $parent_server;
        proxy_set_header Referer           $http_referer;
        proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Real-IP         $remote_addr;
        proxy_set_header Connection        "";
        proxy_pass $parent_protocol://$parent_server;
    }
    # Calls served by Monarch for GDMA Auto-Setup discovery trigger files, such as:
    # /gdma_trigger/myhostname_trigger
    location ^~ /gdma_trigger/ {
        proxy_set_header Host              $parent_server;
        proxy_set_header Referer           $http_referer;
        proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Real-IP         $remote_addr;
        proxy_set_header Connection        "";
        proxy_pass $parent_protocol://$parent_server;
    }
    # Calls served by Monarch for GDMA Plugin List Downloading:
    # /foundation-webapp/restwebservices/pluginUpdates/findUpdates
    location = /foundation-webapp/restwebservices/pluginUpdates/findUpdates {
        proxy_set_header Host              $parent_server;
        proxy_set_header Referer           $http_referer;
        proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Real-IP         $remote_addr;
        proxy_set_header Connection        "";
        proxy_pass $parent_protocol://$parent_server;
    }
    # Calls served by Monarch for GDMA Plugin Downloading:
    # /plugin_download/linux-intel-64/dummyplugin
    # /plugin_download/multiplatform-64/dummyplugin
    location ^~ /plugin_download/ {
        proxy_set_header Host              $parent_server;
        proxy_set_header Referer           $http_referer;
        proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Real-IP         $remote_addr;
        proxy_set_header Connection        "";
        proxy_pass $parent_protocol://$parent_server;
    }
    # Calls served by Monarch for GDMA Auto-Registration:
    # /foundation-webapp/restwebservices/autoRegister/registerAgentByProfile
    location = /foundation-webapp/restwebservices/autoRegister/registerAgentByProfile {
        proxy_set_header Host              $parent_server;
        proxy_set_header Referer           $http_referer;
        proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Real-IP         $remote_addr;
        proxy_set_header Connection        "";
        proxy_pass $parent_protocol://$parent_server;
    }
    # Calls served by Monarch for GDMA Auto-Setup:
    # /foundation-webapp/restwebservices/autoRegister/registerAgentByDiscovery
    location = /foundation-webapp/restwebservices/autoRegister/registerAgentByDiscovery {
        proxy_set_header Host              $parent_server;
        proxy_set_header Referer           $http_referer;
        proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Real-IP         $remote_addr;
        proxy_set_header Connection        "";
        proxy_pass $parent_protocol://$parent_server;
    } 
    CODE
  6. Save the file, you can use :x command.
  7. Restart the revproxy:

    docker exec dockergw8_revproxy_1 bash -e -c "nginx -t; /etc/init.d/nginx reload"
    CODE

At this point, your GDMA agents should auto-register on the Parent normally. Of course, you can adjust this proxy config as needed, however be advised an upgrade to the Child server may require adjusting this change (especially if GroundWork adopts this configuration as default). 

Related Resources