跳到主要内容
版本:3.7.0

在 Windows 上以 Administrator 用户安装 SmartAgent

概述

本文介绍如何在 Windows 系统上安装 SmartAgent。

注意

请勿将安装程序放在 C:\Windows\System32下进行安装。否则将报错:Error launching installer。


安装前准备

  • 在开始安装 Windows 版本的 SmartAgent 前,请确认以下条件:


安装与升级

  1. 登录 Bonree ONE 平台,进入 部署配置 > 安装部署 页面,选择 主机模式 作为部署模式

  2. 下载最新的 SmartAgent-Windows 对应 CPU 架构的安装包:

    powershell -command [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Invoke-WebRequest -Uri 'https://one.bonree.com/agent/down/Bonree-SmartAgent-Windows-<version>.zip' -Headers @{ 'Authorization' = '<token>' } -OutFile 'Bonree-SmartAgent-Windows-<version>.zip'
  3. 解压压缩包

  4. 执行安装命令,并根据需要设置参数(详细安装参数):

    Bonree-SmartAgent.exe -a "<accountGUID>" -u "https://oneupload.bonree.com/APM" --set-env-id "default"

    #如果需要在无人交互模式下静默安装。只需要在开头添加"/S":
    Bonree-SmartAgent.exe /S -a "<accountGUID>" -u "https://oneupload.bonree.com/APM" --set-env-id "default"

验证安装结果

  1. 通过日志确认与平台通信

    C:\Program Files (x86)\bonree\apm\logs\machine\machine.log
  2. 确认驱动状态

  • 打开 计算机 → 设备管理器
  • 找到 smartagentmnt,展开查看 Bonree SmartAgent Device 驱动
    • 正在运行:驱动工作正常,可自动注入 APM 探针
    • 状态异常:驱动不可用,无法自动注入探针
    • 如需禁用,右键点击该驱动,选择 禁用设备
  1. 重启需监控的应用

服务管理

  1. 通过开始菜单

    • 在 开始菜单 → Bonree SmartAgent 目录,点击对应菜单执行操作
  2. 通过服务管理器

    • 打开 服务 或 任务管理器服务标签页
    • 找到 Bonree SmartAgent 服务,右键执行启动/停止/重启
  3. 通过脚本启停

    # 启动
    C:\Program Files (x86)\bonree\apm\startService.bat
    # 停止
    C:\Program Files (x86)\bonree\apm\stopService.bat
    # 重启
    C:\Program Files (x86)\bonree\apm\restartService.bat

卸载

C:\Program Files (x86)\bonree\apm\uninst.exe
注意
  • .NET 探针启用/禁用
    • IIS或使用dotnet命令启动的 .NET 应用默认不自动加载探针
    • 如需启用,可在平台中显式配置 进程深度监控规则