admin 管理员组

文章数量: 887020

目录

  • windows-exporter部署手册
    • 来源
    • 说明
      • 兼容性
    • 部署方式
    • 自定义配置
    • 使用配置文件

windows-exporter部署手册

来源

https://github/prometheus-community/windows_exporter

说明

适用于 Windows 机器的 Prometheus 导出器。

兼容性

windows_exporter 支持 Windows Server 版本 2008R2 和更高版本,以及桌面 Windows 版本 7 和更高版本。

部署方式

下载exporter:
https://github/prometheus-community/windows_exporter/releases/download/v0.16.0/windows_exporter-0.16.0-amd64.exe

可直接执行.exe文件,也可自定义方式启动,直接启动将使用默认配置:

自定义配置

Flags:
  -h, --help                     Show context-sensitive help (also try
                                 --help-long and --help-man).
      --collectors.dfsr.sources-enabled="connection,folder,volume"
                                 Comma-seperated list of DFSR Perflib sources to
                                 use.
      --collectors.exchange.list
                                 List the collectors along with their perflib
                                 object name/ids
      --collectors.exchange.enabled=""
                                 Comma-separated list of collectors to use.
                                 Defaults to all, if not specified.
      --collector.iis.site-whitelist=".+"
                                 Regexp of sites to whitelist. Site name must
                                 both match whitelist and not match blacklist to
                                 be included.
      --collector.iis.site-blacklist=COLLECTOR.IIS.SITE-BLACKLIST
                                 Regexp of sites to blacklist. Site name must
                                 both match whitelist and not match blacklist to
                                 be included.
      --collector.iis.app-whitelist=".+"
                                 Regexp of apps to whitelist. App name must both
                                 match whitelist and not match blacklist to be
                                 included.
      --collector.iis.app-blacklist=COLLECTOR.IIS.APP-BLACKLIST
                                 Regexp of apps to blacklist. App name must both
                                 match whitelist and not match blacklist to be
                                 included.
      --collector.logical_disk.volume-whitelist=".+"
                                 Regexp of volumes to whitelist. Volume name
                                 must both match whitelist and not match
                                 blacklist to be included.
      --collector.logical_disk.volume-blacklist=""
                                 Regexp of volumes to blacklist. Volume name
                                 must both match whitelist and not match
                                 blacklist to be included.
      --collector.msmq.msmq-where=COLLECTOR.MSMQ.MSMQ-WHERE
                                 WQL 'where' clause to use in WMI metrics query.
                                 Limits the response to the msmqs you specify
                                 and reduces the size of the response.
      --collectors.mssql.classes-enabled="accessmethods,availreplica,bufman,databases,dbreplica,genstats,locks,memmgr,sqlstats,sqlerrors,transactions"
                                 Comma-separated list of mssql WMI classes to
                                 use.
      --collectors.mssql.class-print
                                 If true, print available mssql WMI classes and
                                 exit. Only displays if the mssql collector is
                                 enabled.
      --collector.nic-whitelist=".+"
                                 Regexp of NIC:s to whitelist. NIC name must
                                 both match whitelist and not match blacklist to
                                 be included.
      --collector.nic-blacklist=""
                                 Regexp of NIC:s to blacklist. NIC name must
                                 both match whitelist and not match blacklist to
                                 be included.
      --collector.process.whitelist=".*"
                                 Regexp of processes to include. Process name
                                 must both match whitelist and not match
                                 blacklist to be included.
      --collector.process.blacklist=""
                                 Regexp of processes to exclude. Process name
                                 must both match whitelist and not match
                                 blacklist to be included.
      --collector.service.services-where=""
                                 WQL 'where' clause to use in WMI metrics query.
                                 Limits the response to the services you specify
                                 and reduces the size of the response.
      --collector.smtp.server-whitelist=".+"
                                 Regexp of virtual servers to whitelist. Server
                                 name must both match whitelist and not match
                                 blacklist to be included.
      --collector.smtp.server-blacklist=COLLECTOR.SMTP.SERVER-BLACKLIST
                                 Regexp of virtual servers to blacklist. Server
                                 name must both match whitelist and not match
                                 blacklist to be included.
      --collector.textfile.directory="C:\\Program Files\\windows_exporter\\textfile_inputs"
                                 Directory to read text files with metrics from.
      --config.file=CONFIG.FILE  YAML configuration file to use. Values set in
                                 this file will be overriden by CLI flags.
      --web.config.file=""       [EXPERIMENTAL] Path to configuration file that
                                 can enable TLS or authentication.
      --telemetry.addr=":9182"   host:port for exporter.
      --telemetry.path="/metrics"
                                 URL path for surfacing collected metrics.
      --telemetry.max-requests=5
                                 Maximum number of concurrent requests. 0 to
                                 disable.
      --collectors.enabled="cpu,cs,logical_disk,net,os,service,system,textfile"
                                 Comma-separated list of collectors to use. Use
                                 '[defaults]' as a placeholder for all the
                                 collectors enabled by default.
      --collectors.print         If true, print available collectors and exit.
      --scrape.timeout-margin=0.5
                                 Seconds to subtract from the timeout allowed by
                                 the client. Tune to allow for overhead or high
                                 loads.
      --log.level="info"         Only log messages with the given severity or
                                 above. Valid levels: [debug, info, warn, error,
                                 fatal]
      --log.format="logger:stderr"
                                 Set the log target and format. Example:
                                 "logger:syslog?appname=bob&local=7" or
                                 "logger:stdout?json=true"
      --version                  Show application version.

使用配置文件

可以使用–config.file标志指定 YAML 配置文件。例如

.\windows_exporter.exe --config.file=config.yml

config.yml格式如下:

collectors:
  enabled: cpu,cs,net,service
collector:
  service:
    services-where: "Name='windows_exporter'"
log:
  level: warn

本文标签: 手册 Windows exporter