windows-exporter部署手册

windows-exporter部署手册

来源

https://github.com/prometheus-community/windows_exporter

说明

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

兼容性

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

部署方式

下载exporter:
https://github.com/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.net.nic-whitelist=".+"
                                 Regexp of NIC:s to whitelist. NIC name must
                                 both match whitelist and not match blacklist to
                                 be included.
      --collector.net.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

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
如果你想使用podman部署node-exporter,可以按照以下步骤进行操作: 1. 创建一个名为node-exporter的目录,用于存放node-exporter的配置文件和数据。使用以下命令创建: ``` mkdir node-exporter ``` 2. 创建一个名为node-exporter.service的systemd服务单元文件,用于启动node-exporter服务。使用以下命令创建: ``` sudo vi /etc/systemd/system/node-exporter.service ``` 将以下内容复制粘贴到文件中: ``` [Unit] Description=Node Exporter [Service] Restart=always ExecStartPre=podman rm node-exporter ExecStart=/usr/bin/podman run --name node-exporter --net=host --pid=host --privileged=true -v /proc:/host/proc:ro -v /sys:/host/sys:ro -v /:/rootfs:ro -v /etc/node-exporter:/etc/node-exporter:z quay.io/prometheus/node-exporter [Install] WantedBy=multi-user.target ``` 保存并退出文件。 3. 创建一个名为node-exporter的配置文件目录,用于存放node-exporter的配置文件。使用以下命令创建: ``` sudo mkdir /etc/node-exporter ``` 4. 创建一个名为node-exporter.yml的node-exporter配置文件,用于指定node-exporter的参数和监控对象。使用以下命令创建: ``` sudo vi /etc/node-exporter/node-exporter.yml ``` 将以下内容复制粘贴到文件中: ``` global: scrape_interval: 15s scrape_configs: - job_name: 'node' metrics_path: /metrics static_configs: - targets: ['localhost:9100'] ``` 保存并退出文件。 5. 重新加载systemd守护程序并启动node-exporter服务。使用以下命令执行: ``` sudo systemctl daemon-reload sudo systemctl enable node-exporter sudo systemctl start node-exporter ``` 6. 确认node-exporter服务已经成功启动。使用以下命令查看服务状态: ``` sudo systemctl status node-exporter ``` 如果服务状态显示为“active (running)”则表示服务已经启动成功。 希望以上步骤能够帮助你成功部署node-exporter服务。
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值