将uptimerobot.com监视结果导出为prometheus.io度量

ws.prometheus-uptimerobot的Python项目详细描述


https://travis-ci.org/wosc/prometheus-uptimerobot.png

此包将Uptime Robot监视结果导出为Prometheus度量。

用法

配置API密钥

您需要使用 配置文件:

[default]
api_key = 123456789

有关详细信息,请参见Uptime Robot API documentation

设置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从其 数字代码为httphttp keywordpingport之一。

此外,还导出了一个uptimerobot_scrape_duration_secondsgauge。

更改

1.1.0(2018-09-17)

  • 添加SSL过期度量

1.0.1(2018-04-02)

  • 支持API结果分页。

1.0.0(2018-04-01)

  • 第一次释放。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何在安卓 studio中使用调用jaxws web服务的jar文件   java双时间模拟时钟不打印两个不同的时间   java Jackson反序列化处理不带字段的生成值   多线程在java同步中读锁的目的是什么   为什么java中有这么多获取日期时间的方法?   java从listview中的TextView获取数据   java是否可以定义如何对枚举进行(反)序列化以在枚举内持久化?   Java:异常处理我的catch()有问题   VMWare java SDK:可用的PerfMetricID何时不报告数据?   exec在Java中执行命令而不重定向输出   java使用SpringXML配置实现观察者模式?   java在竹笔平板电脑中使用JPen