search
场景和视图 视图模板 Windows 操作系统监控视图

Windows 操作系统监控视图

模板简介

展示 Windows 操作系统的 CPU,内存,磁盘,网络流量,端口,服务,系统基本信息

前置条件

安装 datakit,开启 system,mem,disk,win_perf_counters,win_services,net_response 插件

配置详情

  1. 找到 datakit 默认安装路径的 conf.d 文件夹 (C:\Program Files\dataflux\datakit\conf.d)

  2. 进入 host 目录,复制 mem.conf.sample 为 mem.conf (disk,system 相同)

  3. 进入 windows 目录,复制 win_perf_counters.sample 为 win_perf_counters.conf

  4. 复制 win_services.sample 为 win_services.conf,并添加需要被监控的服务名 (service_names)

  5. 进入 network 目录,复制 net_response.sample 为 net_response.conf,并添加需要被监控的端口号 (address)

  6. 重启 datakit 使配置生效

    [[inputs.mem]]
    [[inputs.system]]
    [[inputs.disk]]
      ignore_fs = ["tmpfs", "devtmpfs", "devfs", "overlay", "aufs", "squashfs"]
    ## Windows 计数器 ##
    [[inputs.win_perf_counters]]
     [[inputs.win_perf_counters.object]]
     ObjectName = "Processor"
     Instances = ["*"]
     Counters = [
     "% Idle Time",
     "% Interrupt Time",
     "% Privileged Time",
     "% User Time",
     "% Processor Time",
     "% DPC Time",
     ]
     Measurement = "win_cpu"
     IncludeTotal=true
    [[inputs.win_perf_counters.object]]
     ObjectName = "LogicalDisk"
     Instances = ["*"]
     Counters = [
     "% Idle Time",
     "% Disk Time",
     "% Disk Read Time",
     "% Disk Write Time",
     "Current Disk Queue Length",
     "% Free Space",
     "Free Megabytes",
     ]
     Measurement = "win_disk"
    [[inputs.win_perf_counters.object]]
     ObjectName = "PhysicalDisk"
     Instances = ["*"]
     Counters = [
     "Disk Read Bytes/sec",
     "Disk Write Bytes/sec",
     "Current Disk Queue Length",
     "Disk Reads/sec",
     "Disk Writes/sec",
     "% Disk Time",
     "% Disk Read Time",
     "% Disk Write Time",
     ]
     Measurement = "win_diskio"
    [[inputs.win_perf_counters.object]]
     ObjectName = "Network Interface"
     Instances = ["*"]
     Counters = [
     "Bytes Received/sec",
     "Bytes Sent/sec",
     "Packets Received/sec",
     "Packets Sent/sec",
     "Packets Received Discarded",
     "Packets Outbound Discarded",
     "Packets Received Errors",
     "Packets Outbound Errors",
     ]
     Measurement = "win_net"
    [[inputs.win_perf_counters.object]]
     ObjectName = "System"
     Counters = [
     "Context Switches/sec",
     "System Calls/sec",
     "Processor Queue Length",
     "System Up Time",
     ]
     Instances = ["------"]
     Measurement = "win_system"
    [[inputs.win_perf_counters.object]]
     ObjectName = "Memory"
     Counters = [
     "Available Bytes",
     "Cache Faults/sec",
     "Demand Zero Faults/sec",
     "Page Faults/sec",
     "Pages/sec",
     "Transition Faults/sec",
     "Pool Nonpaged Bytes",
     "Pool Paged Bytes",
     "Standby Cache Reserve Bytes",
     "Standby Cache Normal Priority Bytes",
     "Standby Cache Core Bytes",
    ]
     Instances = ["------"]
     Measurement = "win_mem"
    [[inputs.win_perf_counters.object]]
     ObjectName = "Paging File"
     Counters = [
     "% Usage",
     ]
     Instances = ["_Total"]
     Measurement = "win_swap"
    ## Windows 服务 ##
    [[inputs.win_services]]
      service_names = [
        "LanmanServer",
        "TermService",
      ]
    ## 端口监控 ##
     [[inputs.net_response]]
       protocol = "tcp"
       address = "localhost:22"
       timeout = "3s"
    

视图概览