Updated on 2026-07-07 GMT+08:00

Step 3: Download and Install the Agent

Scenario

Download and then install the agent on the database or application, as required by the add mode you chose.

Each agent has a unique ID, which is used as the key for connecting to a database audit instance. If you delete an agent and add it back, you need to download the agent again.

Prerequisites

Downloading an Agent

  1. Log in to the DBSS console.
  2. Click in the upper left corner on the displayed page and select a region.
  3. In the navigation tree on the left, choose Databases.
  4. In the Instance drop-down list, select the instance whose agent is to be downloaded.
  5. Locate the row that contains the target database, and click View Agent in the Agent column. In the Agents area, locate the row that contains the target agent and click Download Agent in the Operation column to download the agent installation package.

    Figure 1 Downloading an Agent

    Download the agent installation package suitable for your OS.

    • Linux OS

      Download the agent whose OS is LINUX64.

    • Windows OS

      Download the agent whose OS is WINDOWS64.

Common Deployment Scenarios

You can install the agent on the database or application side, depending on your database type and deployment scenario. Common database scenarios are as follows:

  • Deploy DBSS for databases built on ECS/BMS. For details, see Figure 2 and Figure 3.
    Figure 2 One application connecting to multiple databases built on ECS/BMS
    Figure 3 Multiple applications connecting to one database built on ECS/BMS
  • Deploy DBSS for RDS databases. For details, see Figure 4 and Figure 5.
    Figure 4 One application connecting to multiple RDS databases
    Figure 5 Multiple applications connecting to one RDS database

Table 1 describes where to install the agent in the preceding scenarios.

If your applications and databases (databases built on ECS/BMS) are deployed on the same node, install the agent on the database side.

Table 1 Agent installation scenarios

Application Scenarios

Node

Audit Scope

Configuration

Self-built database on ECS/BMS

Database side

Access records of all the applications that have accessed the database

If an application connects to multiple databases built on ECS/BMS, the agent must be installed on all these databases.

RDS database

Application side (if the applications are deployed on the cloud)

Access records of all the databases connected to the application

If multiple applications are connected to the same RDS database, the agent must be installed on all these applications.

RDS database

Proxy side (if applications are deployed off the cloud)

Only the access records between the proxy and database. Those between the applications and database cannot be audited.

None.

Configuring Database Audit with Installing Agent

You can enable database audit only after the agent is installed. This topic describes how to install the agent on a node running a Linux OS and Windows OS.

Before installing the agent, prepare a password.

Install the agent on the node suitable for your service scenario.

  1. Upload the downloaded agent installation package xxx.tar.gz to the node (for example, using WinSCP).
  2. Log in to the node as user root using SSH through a cross-platform remote access tool (for example, PuTTY). If you are auditing an RDS database, install the agent on the application server if host access to RDS instances is not available.
  3. Run the following command to access the directory where the agent installation package xxx.tar.gz is stored:

    cd Directory_containing_agent_installation_package

  4. Run the following command to decompress the installation package xxx.tar.gz:

    tar -xvf xxx.tar.gz

  5. Run the following command to switch to the directory containing the decompressed files:

    cd Decompressed_package_directory

  6. Run the following command to check whether you have the permission for executing the install.sh script:

    ll
    • If you do, go to 7.
    • If you do not, perform the following operations:
      1. Run the following command to get the script execution permission:
        chmod +x install.sh
      2. Verify you have the required permissions.

  7. Run the following command to install the agent:

    sh install.sh

    • In Ubuntu, run the bash install.sh command to install the agent.
    • The agent is run by common DBSS users. When installing the agent for the first time, a DBSS user will be created. After running the sh install.sh command, you can use the prepared password set up the DBSS user.
    If the following information is displayed, the agent has been installed. Otherwise, the installation fails.
    1
    2
    3
    4
    5
    start agent
    starting audit agent
    audit agent started
    start success
    install dbss audit agent done!
    

    If the agent installation failed, ensure the OS version of the target node is supported and try again.

  8. Run the following command to view the running status of the agent program:

    service audit_agent status

    If the following information is displayed, the agent is running properly:

    audit agent is running.

  1. Install Npcap on Windows OS.

    • If Npcap has been installed on the Windows OS, go to 3.
    • If Npcap has not been installed on the Windows OS, perform the following steps:
      1. Download Npcap to obtain the latest installation package.
        Figure 6 Downloading Npcap
      2. Upload the npcap-xxxx.exe software installation package to the VM where the agent is to be installed.
      3. Double-click the Npcap installation package.
      4. In the displayed dialog box, click I Agree, as shown in Figure 7.
        Figure 7 Agreeing to install Npcap
      5. In the displayed dialog box, leave all the check boxes unselected and click Install, as shown in Figure 8.
        Figure 8 Installing Npcap
      6. In the displayed dialog box, click Next.

      7. Click Finish.

  2. Obtain the Agent installation package for Windows by referring to Downloading an Agent.
  3. Log in to the node as the Administrator user and copy the downloaded agent installation package xxx.zip to any directory on the host.

    Figure 9 Agent installation package

  4. Decompress the package.
  5. Double-click the install.bat file in the package directory.

    Figure 10 Double-clicking install.bat

  6. Press any key to complete installation after the output shown in Figure 11 is displayed.

    Figure 11 Installation completed

  7. Check the installation result. If the dbss_audit_agent process can be found in the Windows Task Manager, the installation succeeded, as shown in Figure 12.

    Figure 12 Checking the dbss_audit_agent process

    If it is not found, the installation failed. Install the agent again.

References

  • If you use an agent to audit a user-built database or a cloud database, disable SSL for the database. Otherwise, the audit will fail. For details, see How Do I Disable SSL for a Database?