GDMA Advanced

Version 1 by Bren Eckles
on May 11, 2012 12:47.

compared with
Current by Bren Eckles
on Nov 05, 2015 09:49.

Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (45)

View Page History
h5. Enable the Plugin Download Feature

# Edit the file:bren
{newcode}/usr/local/groundwork/config/foundation.properties{newcode} {code}/usr/local/groundwork/config/foundation.properties{code}
change:
{newcode}gdma.plugin.upload.enable=false{newcode} {code}gdma.plugin.upload.enable=false{code}
to:
{newcode}gdma.plugin.upload.enable=true{newcode} {code}gdma.plugin.upload.enable=true{code}
and save the file.
# Edit the file:
{newcode}/usr/local/groundwork/apache2/conf/httpd.conf{newcode} {code}/usr/local/groundwork/apache2/conf/httpd.conf{code}
change:
{newcode}#Alias /plugin_download "/usr/local/groundwork/apache2/htdocs/agents/plugin_download"{newcode}
{code}#Alias /plugin_download "/usr/local/groundwork/apache2/htdocs/agents/plugin_download"{code}
to:
{newcode}Alias /plugin_download "/usr/local/groundwork/apache2/htdocs/agents/plugin_download"{newcode}
{code}Alias /plugin_download "/usr/local/groundwork/apache2/htdocs/agents/plugin_download"{code}
and save the file.
# Restart gwservices, run as {{root}}:
{newcode}/etc/init.d/groundwork restart gwservices{newcode}
{code}/etc/init.d/groundwork restart gwservices{code}
# Restart apache, run as {{root}}:
{newcode}/etc/init.d/groundwork restart apache{newcode}
{code}/etc/init.d/groundwork restart apache{code}
{Note}This will log off all users.{Note}

{Note}Only modify host externals for hosts running _GDMA_ (2.2.1 or later). Older versions will error out if these parameters are placed in the host externals.{Note}
# Add the following lines to the selected host external where <Server Name> is the resolvable name of the GroundWork server from the point of view of the GDMA:
{newcode}Enable_Poller_Plugins_Upgrade = "On"
Poller_Plugins_Upgrade_URL="http://<Server Name>/foundation-webapp/restwebservices/pluginUpdates/findUpdates"{newcode}
You may also use an https URL if you have configured _GroundWork Monitor_ to use _HTTPS_, e.g:
{newcode}Poller_Plugins_Upgrade_URL="https://<Server Name>/foundation-webapp/restwebservices/pluginUpdates/findUpdates"{newcode}
{code}Poller_Plugins_Upgrade_URL="https://<Server Name>/foundation-webapp/restwebservices/pluginUpdates/findUpdates"{code}
# Save the host external and choose Replace existing externals or Merge with existing externals as appropriate.
# Go to Configuration>Control, and select Build Externals.

In particular you MUST enable Powesershell to run scripts. To do this, launch each version of the Powershell interpreter on your system (both the 64 bit Windows Powershell and the 32-bit Windows Powershell (x86)), and type:
{newcode}Set-ExecutionPolicy RemoteSigned{newcode}
{code}Set-ExecutionPolicy RemoteSigned{code}

h5. Loading Example Profile
{Note}The service externals are not generic, and may need to be modified to work with your system.{Note}
The service externals assume the default location of Powershell and GDMA. The example here explicitly calls {{powershell.exe}} in the default location, and passes it the full, no-spaces version of the path to the Powershell script to run. The quoting used is standard, and can be used in most cases. See 'Command='Line Tricks below.
{newcode}Check_gdma_powershell_getcounter\[1\]_Command="c:\windows\system32\WindowsPowerShell\v1.0\powershell.exe 'C:\Progra~2\groundwork\gdma\libexec\v3\getCounter.ps1'"{newcode}
{code}Check_gdma_powershell_getcounter[1]_Command="c:\windows\system32\WindowsPowerShell\v1.0\powershell.exe 'C:\Progra~2\groundwork\gdma\libexec\v3\getCounter.ps1'"{code}

If you instal GDMA in a different directory, you will need to modify this path. The short form Progra~2 expands out to Program Files (x86), which is where GDMA, a 32-bit program, is installed in 64-bit Windows by default.

The entire command line is enclosed in double quotes. Within this enclosure, there are two main sections. The first is the executing program ({{cscript.exe}}, in this case, but in the Powershell example in the previous section, it was {{powershell.exe}}). Any arguments to the executing program come next. If you are using UNIX, the executing program is implicit: the command shell. In that case you can stop there, for example:
{newcode}Check_gdma_linux_mem[1]_Command="check_mem.pl -F -w 20 -c 10"{newcode}
In Windows, as well, you can run compiled programs as plugins in this way without any further specifications. Just be sure to include the enclosing double quotes.

One way to manage this situation is to set up GDMA to use an alternate send_nsca.cfg file. This file can be downloaded to the GDMA as if it were a plugin, and specified for use via the host external using the GDMA parameter called Spooler_NSCA_Config. For example:
If you create a file called:
{newcode}send_nsca_gdma_encrypted.cfg{newcode} {code}send_nsca_gdma_encrypted.cfg{code}
and you set it up for download as a plugin for Linux, it will be placed on the Linux GDMA in:
{newcode}/usr/local/groundwork/gdma/tmp/send_nsca_gdma_encrypted.cfg{newcode} {code}/usr/local/groundwork/gdma/tmp/send_nsca_gdma_encrypted.cfg{code}
That means you could set up the GDMA to start using this file at the same time you switch the GroundWork server to use encryption, just by changing:
{newcode}Spooler_NSCA_Config="/usr/local/groundwork/gdma/tmp/send_nsca_gdma_encrypted.cfg"{newcode} {code}Spooler_NSCA_Config="/usr/local/groundwork/gdma/tmp/send_nsca_gdma_encrypted.cfg"{code}

h5. Generating Logs

In Windows, open a command shell, and type:
{newcode}cd \Program Files\groundwork\gdma\bin
gdma_poll.exe -i -d2 -x{newcode}
As the Windows GDMA can be installed in alternate locations, you may need to enter a different path. For example in 64-bit Windows, GDMA is installed in \Program Files (x86)\groundwork\gdma by default.

This will give you output similar to the following:bren
{newcode:Syntax highlighting=none}C:\Users\Administrator>cd {code}C:\Users\Administrator>cd "\Program Files (x86)\groundwork\gdma"\bin

C:\Program Files (x86)\groundwork\gdma\bin>gdma_poll.exe -i -d2 -x
Getting http://gdma-autohost/gdma/gwmon_wingdma64-qa-2.cfg [http://gdma-autohost/gdma/gwmon_wingdma64-qa-2.cfg] to C:\Program Files (x86)\groundwork\gdma\config\gwmon_wingdma64-qa-2.cfg(timeout 10)
Attempting to get http://gdma-autohost/gdma/gwmon_wingdma64-qa-2.cfg [http://gdma-autohost/gdma/gwmon_wingdma64-qa-2.cfg] to C:\Program Files (x86)\groundwork\gdma\config\gwmon_wingdma64-qa-2.cfg (timeout is set to 10)
get_gdma_cfg_file_using_http: config file modified

Retrieved content for [http://gdma-autohost/gdma/gwmon_wingdma64-qa-2.cfg]

Checking autoconfig file for a change.
Spooling poller startup message
spool_startup_info: Poller 2.2.2 started at Wednesday January 12 11:34:25 2011
Pushed result into the buffer: 0 0 1294860865 wingdma64-qa-2 gdma_poller 0   Poller &nbsp;&nbsp;Poller 2.2.2 started at Wednesday January 12 11:34:25 2011
Executing poller normal mode.
ConfigFile_Pull_Cycle = 1
Spooler_Service = gdma_spooler
Spooler_Status = Updates
Target_Server = [http://gdma-autohost]
wingdma64-qa-2_Check_gdma_powershell_getcluster[1]_Command = c:\windows\system32\WindowsPowerShell\v1.0\powershell.exe C:\Progra~2\groundwork\gdma\libexec\v3\getCluster.ps1
...{newcode}

There are several diagnostic steps that GDMA goes through each time it runs. Errors in the retrieval of the config file, or with a syntax error in that file, will be presented near the top of this output. Any problems running the checks will appear in the last sections.

If all of that is working ok, then you might try running the spooler:
{newcode}C:\Program Files (x86)\groundwork\gdma\bin>gdma_spool_processor.exe -i -d2 -x
Checking config [file:C:\Program] Files (x86)\groundwork\gdma\config\gwmon_wingdma64-qa-2.cfg for a change.
Checking config [file:C:\Program] Files (x86)\groundwork\gdma\config\gwmon_wingdma64-qa-2.cfg (x86)\groundwork\gdma\config\gdma_auto.conf for a change.
Checking config file:C:\Program Files (x86)\groundwork\gdma\config\gdma_auto.conf for a change.
Reloading config files.
Sucessfully read host config file
Spooler_Service = gdma_spooler
Spooler_Status = Updates
Target_Server = [http://gdma-autohost]
wingdma64-qa-2_Check_gdma_powershell_getcluster[1]_Command = c:\windows\system32\WindowsPowerShell\v1.0\powershell.exe C:\Progra~2\groundwork\gdma\libexec\v3\getCluster.ps1
wingdma64-qa-2_Check_gdma_powershell_getcluster[1]_Enable = ON
Pushed result into the buffer: 0 0 1294861132 wingdma64-qa-2 gdma_spooler 0 Spooler transmitted 2 results in 0.308 secs | RESULTS=2;;;;T
IME=0.308sec;;;;
Loop count=0. Last loop exec time = 0.313 seconds.{newcode}

The spooler merely takes output from the checks that have been run and sends it to the Target server or servers. Of interest here is if it succeeded in contacting the Target, which will be indicated as Processing live targets. Dead targets are Target servers that can't be reached for some reason, and indicate a down primary or standby system, or network issues in contacting the Target. The spooler will keep trying until it reaches a dead target, or times out according to the Spooler_Retention_Time and Spooler_Max_Retries parameters.

h6. *On Linux and AIX*
{newcode}su - gdma
cd /usr/local/groundwork/gdma/bin
/usr/local/groundwork/perl/bin/perl gdma_poll.pl -i -d2 -x{newcode}

h6. *On Solaris*
{newcode}su - gdma
cd /opt/groundwork/gdma/bin
/opt/groundwork/perl/bin/perl gdma_poll.pl -i -d2 -x{newcode}
The output is essentially the same for UNIX as for Windows.