How can I monitor another server from my pc using prometheus and telegraf? Do I need to install telegraf on both of them?
Your question would benefit from more precision including a description of what you've tried (even hypotheses). For this reason, it may get flagged.
Until then...
It appears that Telegraf supports Prometheus as an output plugin ( link ).
So you should be able to:
Assuming you use a Telegraf config of the form:
[[outputs.prometheus_client]]
## Address to listen on.
listen = ":9273"
You should be able to browse|curl http://localhost:9273/metrics
from the host on which Telegraf's running to see the metrics it exposes.
NOTE If not
localhost
(127.0.0.1
) then replacelocalhost
with the host's name|address.
Then you will want to configure a Prometheus scrape target to scrape the Telegraf metrics:
scrape_configs:
# Telegraf
- job_name: "telegraf-agent"
static_configs:
- targets:
- "localhost:9273"
# Self
- job_name: "prometheus-server"
static_configs:
- targets:
- "localhost:9090"
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.