Granting privileges for viewing Db2 metrics

To monitor the Db2® resources, a Db2 user must have the Db2 SYSADM, SYSCTRL, SYSMAINT, and SYSMON authorities for the monitored instance to view data for some attributes of the Db2 agent.

About this task

To view the monitoring data that the agent collects for all the attributes on the dashboard, the Db2 user must have specific privileges. To assign these privileges to the Db2 user, run the script file that is present at the following location:
  • Linux or AIX install_dir/config/KudGrantUserPermissions.sh
  • Windows install_dir\TMAITM6_x64\KudGrantUserPermissions.bat
A Db2 user with the SYSADM authority can run the script to grant privileges to itself or to any other Db2 user. For a Db2 instance, use the instance owner, which already has the SYSADM authority, to run the script to grant other permissions to itself or to grant all the permissions to any other Db2 user.

Procedure

  1. For local monitoring, refer the following steps.
    1. On the system where the Db2 agent in installed, open the Db2 command-line interface.
    2. Run the following command where instance_name is the name of the Db2 instance and username is the name of the Db2 user:
      • Linux or AIX install_dir/config/KudGrantUserPermissions.sh instance_name username
      • Windows install_dir\TMAITM6_x64\KudGrantUserPermissions.bat instance_name username
      Note: For Windows systems, username is optional in the command. If a user name is not specified in the command, the privileges are assigned to the default user (system).
  2. For remote monitoring, refer the following steps.
    1. Copy KudGrantUserPermissions.sh for Unix or Linux® and KudGrantUserPermissions.bat for Windows from install_dir/TMAITM6_x64/ from agent workstation to Db2 server machine.
    2. Run the following command from Db2 instance owner user where instance_name is the name of the Db2 instance and username is the name of the Db2 user:
      • Linux or AIX ./KudGrantUserPermissions.sh instance_name username
      • Windows KudGrantUserPermissions.bat instance_name username
      Remember: For remote Db2 monitoring on Windows, the username must be the user name that is provided during the Db2 agent configuration at client workstation.
  3. On HADR standby database, refer the following steps.
    1. Copy KudGrantUserPermissions.sh for Unix or Linux and KudGrantUserPermissions.bat for Windows from install_dir/TMAITM6_x64/ of agent workstation to Db2 server machine where the primary node of HADR is configured.
    2. Run the following command from Db2 instance owner user where instance_name is the name of the Db2 instance and username is the name of the standby Db2 user:
      Windows
      
      KudGrantUserPermissions.bat instance_name username
      
      Linux
      ./KudGrantUserPermissions.sh instance_name username
    3. Switch to HADR standby instance to deactivate standby database and re-activate it. Deactivation and re-activation enable the privilege granting to take effect.