将uptimerobot.com监视结果导出为prometheus.io度量
ws.prometheus-uptimerobot的Python项目详细描述
此包将Uptime Robot监视结果导出为Prometheus度量。
用法
设置http服务
然后您需要设置一个http服务器,或者使用一个专用进程:
$ uptimerobot_exporter --host localhost --port 9429 --config /path/to/config
或者作为一个cgi脚本,如果你有基础设施的话。 下面是一个apache配置片段示例:
ScriptAlias /metrics/uptimerobot /path/to/uptimerobot_exporter_cgi <Location /metrics/uptimerobot> SetEnv PROMETHEUS_UPTIMEROBOT_CONFIG /path/to/config # SetEnv PROMETHEUS_UPTIMEROBOT_LOGFILE /path/to/log # optional, for debugging </Location>
配置普罗米修斯
scrape_configs: - job_name: 'uptimerobot' scrape_interval: 300s static_configs: - targets: ['localhost:9429']
将导出以下度量,每个度量都带有标签{monitor_name="example.com",monitor_type="http",monitor_url="https://example.com"}:
- uptimerobot_upgauge(1=向上,0=向下)
- uptimerobot_statusgauge
- uptimerobot_responsetimegauge
- uptimerobot_ssl_expiregauge(unix时间戳),如果适用
有关详细信息,请参见Uptime Robot API documentation部分“参数” 可能的status值。monitor_type从其 数字代码为http、http keyword、ping或port之一。
此外,还导出了一个uptimerobot_scrape_duration_secondsgauge。
更改
1.1.0(2018-09-17)
- 添加SSL过期度量
1.0.1(2018-04-02)
- 支持API结果分页。
1.0.0(2018-04-01)
- 第一次释放。