【问题标题】:Is it possible to query data from Whisper (Graphite DB) from console?是否可以从控制台查询来自 Whisper (Graphite DB) 的数据?
【发布时间】:2014-10-28 09:38:28
【问题描述】:

我已配置 Graphite 来监控我的应用程序指标。我配置了 Zabbix 来监控我的服务器 CPU 和其他指标。 现在我想将一些关键的 Graphite 指标传递给 Zabbix 来为它们添加触发器。

所以我想做类似的事情

$ whisper get prefix1.prefix2.metricName
> 155

有可能吗?

附:我知道 Graphite-API 项目,我不想安装额外的应用程序。

【问题讨论】:

    标签: api console graphite whisper


    【解决方案1】:

    【讨论】:

    • 如果有一个不涉及 webapp 的解决方案(无论是使用浏览器访问还是 curl 访问),那就太好了。
    【解决方案2】:

    您可以使用whisper安装包中提供的whisper-fetch程序。 像这样使用它:

    whisper-fetch /path/to/dot.wsp
    

    或者得到例如最近 5 分钟的数据:

    whisper-fetch --from=$(date +%s -d "-5 min") /path/to/dot.wsp
    

    默认值将导致如下输出:

    1482318960  21.187000
    1482319020  None
    1482319080  21.187000
    1482319140  None
    1482319200  21.187000
    

    您可以使用 --json 选项将其更改为 json。

    【讨论】:

    • 查找文件:find /var/lib/graphite/ -name *.wsp
    猜你喜欢
    • 1970-01-01
    • 2023-03-11
    • 2016-11-20
    • 1970-01-01
    • 2012-12-10
    • 2011-02-08
    • 1970-01-01
    • 1970-01-01
    • 2016-10-21
    相关资源
    最近更新 更多