GIM CLI commands

You can use the CLI to install and upgrade modules on the database server.

The following examples are presented only to cover some of the more common scenarios. For more information and a complete list of all supported CLI commands, see Guardium Installation Manager (GIM) APIs.
  • Loading module packages
  • Upgrade or Scratch install by using bundles
  • Uninstall a module or bundle
  • Installation Status
  • Querying modules state

Loading module packages

Before modules can be installed on DB server, they must be loaded onto the Central Manager GIM database. If a Central Manager is not part of the architecture, packages must be loaded onto each Guardium® system. Use the Load package option in the GIM UI to get the packages loaded to the database.

Upgrade or Scratch install by using bundles

Note: Scratch installation refers also to a case where old (pre-GIM) S-TAP is installed on the database server.
A bundle is a list of modules that are grouped for ease of installation. Always use bundles to install or upgrade modules.
  1. Get the list of registered clients (database servers installed with GIM client that have registered with the GIM server):
    grdapi gim_list_registered_clients
    ID=0
    ####### ENTRY 0 #######       
    CLIENT_ID:          1              
    IP:                 192.168.2.204       
    OS:                 HP-UX     
    OS_RELEASE:         B.11.00        
    OS_VENDOR:          hp             
    OS_VENDOR_VERSION:  B.11.00             
    OS_BITS:            64        
    PROCESSOR           9000           
    ####### ENTRY 1 #######       
    CLIENT_ID:          2              
    IP:                 192.168.2.210       
    OS:                 Linux     
    OS_RELEASE:         2.6.16.54-0.2.5-smp
    OS_VENDOR:          suse           
    OS_VENDOR_VERSION:  10.1                
    OS_BITS:            64        
    PROCESSOR           x86_64    
    
  2. Assign (prepare to install; NOT a request to install it on the client) the latest bundle available for a specific client:
    grdapi gim_assign_latest_bundle_or_module_to_client  clientIP=198.168.2.210 moduleName=BUNDLE-STAP
    
    Note: To assign a specific bundle or module to a client, use this sequence:
    gim_get_available_modules clientIP=”client ip” 
    gim_assign_bundle_or_module_to_client_by_version clientIP=”client ip” modulesName=”Bundle/Module name”  moduleVersion=”Bundle/Module version” 
    
  3. Schedule the installation.
    grdapi gim_schedule_install clientIP=192.168.2.210 date=now
    
    Note: For multiple client installation repeat steps 2-3.
    Note: For flexible GIM scheduling, use now + [1-9][0-9]* minute | hour | day | week | month. Example: now + 1 day, now + 3 minutes

GIM scheduling

All time is relative to Guardium system time. Now means right now as specified by the Guardium system. Now +30 minutes is the current Guardium system time + 30 minutes. If the time on the database server has passed the time on the Guardium system that is specified for installation, then the installation begins.

Example one, set up three clients (a) set for Guardium system time - 1 hour, (b) set for Guardium system time, and (c) set for Guardium system time + 1 hour.

Set up an S-TAP installation by using GIM for "now +30 minutes".

Guardium system (a), which is already 30 minutes ahead of the time set for installation, installs immediately.

Guardium system (b) installs in 30 minutes.

Guardium system (c) takes another hour after (b) to install.

Example two - Same setup as example one but this time specify "now".

Installation status changes to IP immediately on all clients.

Uninstalling a module or bundle

grdapi gim_uninstall_module clientIP=192.168.2.210 module=BUNDLE-STAP date=now
You can specify date=now or use the format of YYYY-MM-DD HH:mm. The uninstallation will take place the next time GIM client checks for updates (GIM_INTERVAL).

Installation Status

Additional information about the latest status the client sent can be retrieved by running the following command. (The status message appears as an entry in GIM_EVENTS table from which a report can be generated):

The general status message can be obtained by running the following CLI command:
grdapi gim_get_client_last_event clientIP="client ip"
grdapi gim_get_client_last_event clientIP=winx64
grdapi gim_get_client_last_event clientIP=9.70.144.73
Sample output from this command:
ID=0
OK
BUNDLE-STAP-8.0_r2609_1 INSTALLED
STAP-UTILS-8.0_r2609_1 INSTALLED
COMPONENTS-8.0_r2609_1 INSTALLED
KTAP-8.0_r2609_1 INSTALLED
STAP-8.0_r2609_1 INSTALLED
TEE-8.0_r2609_1 INSTALLED
ATAP-8.0_r2609_1 INSTALLED

Querying modules state

To query the installed module's state per client, enter the following CLI command:
grdapi gim_list_client_modules clientIP=”client ip”
The following states are possible:
INSTALLED
Module is installed.
PENDING-INSTALL
Module is pending to be scheduled for installation.
PENDING-UNINSTALL
Module is pending to be scheduled for uninstallation.
PENDING-UPDATE
Module is pending to be scheduled for update.
IP
Module installation is in progress.
FAILED
Module's last operation failed.
IP-PR
Module requires client reboot to complete the installation process. Before rebooting, deactivate all A-TAP instances. Rebooting the database server is different per OS (Any other way of rebooting the system keeps the pending modules in a pending state).
  •  AIX: reboot
  • Linux® shutdown -r
  • SuSe: reboot
  • HP-UX: shutdown -r
  • Solaris: shutdown -i [6|0]  (Note: '0' can be used only if shutdown is done from the terminal server)
Output example:
ID=0
####### ENTRY 0 #######       
MODULE_ID:          11        
NAME:               INIT                
INSTALLED_VERSION   8.0_r3852_1                   
SCHEDULED_VERSION   8.0_r3852_1                   
STATE:              INSTALLED           
IS_SCHEDULED:       N                   
####### ENTRY 1 #######       
MODULE_ID:          -1        
NAME:               COMMON              
INSTALLED_VERSION   8.0_r0_1                      
SCHEDULED_VERSION   8.0_r0_1                      
STATE:              INSTALLED           
IS_SCHEDULED:       N                   
####### ENTRY 2 #######       
MODULE_ID:          12        
NAME:               UTILS               
INSTALLED_VERSION   8.0_r3852_1                   
SCHEDULED_VERSION   8.0_r3852_1                   
STATE:              INSTALLED           
IS_SCHEDULED:       N                   
####### ENTRY 3 #######       
MODULE_ID:          13        
NAME:               SUPERVISOR          
INSTALLED_VERSION   8.0_r3852_1                   
SCHEDULED_VERSION   8.0_r3852_1                   
STATE:              INSTALLED           
IS_SCHEDULED:       N                   
####### ENTRY 4 #######       
MODULE_ID:          14        
NAME:               GIM                 
INSTALLED_VERSION   8.0_r3852_1                   
SCHEDULED_VERSION   8.0_r3852_1                   
STATE:              INSTALLED           
IS_SCHEDULED:       N                   
####### ENTRY 5 #######       
MODULE_ID:          15        
NAME:               BUNDLE-GIM          
INSTALLED_VERSION   8.0_r3852_1                   
SCHEDULED_VERSION   8.0_r3852_1                   
STATE:              INSTALLED           
IS_SCHEDULED:       N