alt=”windows_exporter 安裝” />
Windows_exporter 安裝背景如果您想通過Prometheus監(jiān)控Windows主機(jī)的相關(guān)參數(shù),那么在Windows系統(tǒng)的主機(jī)上安裝指標(biāo)收集器是必不可少的步驟。
windows_exporter 是由prometheus官方提供的用于收集指標(biāo)的工具。
下載您可以從以下地址下載最新版本的windows_exporter:https://www.php.cn/link/86f48b1de523b6159630d09f56f31f1f
運(yùn)行下載完成后,雙擊即可啟動(dòng)程序,但這種方式需要保持程序在前臺(tái)運(yùn)行。為了便于管理,可以將程序注冊(cè)為Windows服務(wù)。
代碼語言:JavaScript代碼運(yùn)行次數(shù):0運(yùn)行復(fù)制“`javascript sc create windows_exporter binpath= “C:windwos_exporterwindows_exporter.exe” type= own start= auto displayname= windows_exporter
复制代码
- 注意:binpath后面應(yīng)接.exe程序所在的路徑和程序名稱。 <p>配置在新的CMD窗口中輸入services.msc打開Windows的服務(wù)管理窗口。找到windows_exporter服務(wù),右鍵點(diǎn)擊并選擇屬性,在啟動(dòng)參數(shù)中添加–telemetry.addr=0.0.0.0:9182,配置完成后,重啟服務(wù)即可。</p><p>訪問服務(wù)啟動(dòng)后,通過訪問主機(jī)的IP加端口號(hào),例如:192.168.1.100:9182,即可查看服務(wù)狀態(tài)。</p><p>Prometheus增加配置代碼語言:javascript代碼運(yùn)行次數(shù):0<svg fill="none" height="16" viewbox="0 0 16 16" width="16" xmlns="<a href="https://www.php.cn/link/c9041cfd2a40932691855abd98fd219a">http://www.w3.org/2000/svg"><path</a> d="M6.66666 10.9999L10.6667 7.99992L6.66666 4.99992V10.9999ZM7.99999 1.33325C4.31999 1.33325 1.33333 4.31992 1.33333 7.99992C1.33333 11.6799 4.31999 14.6666 7.99999 14.6666C11.68 14.6666 14.6667 11.6799 14.6667 7.99992C14.6667 4.31992 11.68 1.33325 7.99999 1.33325ZM7.99999 13.3333C5.05999 13.3333 2.66666 10.9399 2.66666 7.99992C2.66666 5.05992 5.05999 2.66659 7.99999 2.66659C10.94 2.66659 13.3333 5.05992 13.3333 7.99992C13.3333 10.9399 10.94 13.3333 7.99999 13.3333Z" fill="currentcolor"></path></svg>運(yùn)行<svg fill="none" height="16" viewbox="0 0 16 16" width="16" xmlns="<a href="https://www.php.cn/link/c9041cfd2a40932691855abd98fd219a">http://www.w3.org/2000/svg"><path</a> clip-rule="evenodd" d="M4.5 15.5V3.5H14.5V15.5H4.5ZM12.5 5.5H6.5V13.5H12.5V5.5ZM9.5 2.5H3.5V12.5H1.5V0.5H11.5V2.5H9.5Z" fill="currentcolor" fill-rule="evenodd"></path></svg>復(fù)制```javascript</p><ul><li>job_name: "windwos_exporter" scrape_interval: 15s static_configs: - targets: ["192.168.1.100:9182"]
添加上述配置后,重啟Prometheus服務(wù)即可。
grafana面版配置在https://www.php.cn/link/8854e85268e5bfb9fa2b5d70798a987a網(wǎng)頁中搜索并選擇一個(gè)適合的監(jiān)控面板,然后導(dǎo)入到Grafana中使用。