node-export----Windows node-export作為服務(wù)啟動

1、創(chuàng)建服務(wù)
sc create windows_exporter binpath= C:\windows_exporter-0.24.0-amd64.exe type= own start= auto displayname= windows_exporter
2、services.msc添加啟動參數(shù)啟動
--telemetry.addr=0.0.0.0:9182
3、訪問測試
http://127.0.0.1:9182/metrics

windows_exporter 由 Prometheus Community 維護(hù)windows_exporter是一個采集 Windows 機(jī)器指標(biāo)的采集器。
windows_exporter在發(fā)布的是時候提供了兩種格式的文件,分別是 *.exe 和 *.msi 。MSI (Microsoft Installers)是 Windows 的包管理器,類似于 Linux 的 rpm 。windows_exporter每個版本都提供一個 .msi 安裝程序。安裝程序?qū)?windows_exporter 設(shè)置為 Windows 服務(wù),并在 Windows 防火墻中創(chuàng)建一個入站規(guī)則。
windows_exporter 官網(wǎng) https://github.com/prometheus-community/windows_exporter

windows_exporter.exe 文件 C盤根目錄下

sc create windows_exporter binpath= C:\windows_exporter-0.24.0-amd64.exe type= own start= auto displayname= windows_exporter
sc create的用法說明:
C:\Users\Administrator>sc create
描述:
        在注冊表和服務(wù)數(shù)據(jù)庫中創(chuàng)建服務(wù)項(xiàng)。
用法:
        sc <server> create [service name] [binPath= ] <option1> <option2>...
選項(xiàng):
注意: 選項(xiàng)名稱包括等號。
      等號和值之間需要一個空格。
 type= <own|share|interact|kernel|filesys|rec>
       (默認(rèn) = own)
 start= <boot|system|auto|demand|disabled|delayed-auto>
       (默認(rèn) = demand)
 error= <normal|severe|critical|ignore>
       (默認(rèn) = normal)
 binPath= <BinaryPathName>
 group= <LoadOrderGroup>
 tag= <yes|no>
 depend= <依存關(guān)系(以 / (斜杠) 分隔)>
 obj= <AccountName|ObjectName>
       (默認(rèn) = LocalSystem)
 DisplayName= <顯示名稱>
 password= <密碼>
image.png

注冊成功后服務(wù)列表查看windows_exporter服務(wù)
選中windows_exporter服務(wù),右鍵菜單中點(diǎn)擊屬性,在屬性對話框輸入啟動參數(shù):

--telemetry.addr=0.0.0.0:9182
image.png

然后啟動服務(wù),查看 windows_exporter metrics 采集指標(biāo)
windows_exporter默認(rèn)端口是9182,http://127.0.0.1:9182/metrics

image.png

刪除 windows_exporter 服務(wù)

sc delete windows_exporter

Prometheus 添加 windows_exporter 節(jié)點(diǎn)監(jiān)控

vim /usr/local/prometheus/prometheus.yml

- job_name: "windows-node"
    scrape_interval: 60s
    static_configs:
      - targets: ['192.168.100.85:9182']
        labels:
          project: windows_node_exporter
    relabel_configs:
      - source_labels: [__address__]
        target_label: instance
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容