Ganglia 指标值衰减为零

发布于 2024-10-21 01:11:09 字数 113 浏览 2 评论 0原文

我每 5 分钟使用 Gmetric 向 Ganglia 发送一次指标。但是,如果发送指标的 cron 任务不起作用,我预计 Ganglia 图上的指标值会变为零,而它会保持其最后更新的值。有没有办法改变这种行为?

I am sending metrics to Ganglia using Gmetric once every 5 minutes. But if the cron task that is sending the metrics is not working, I would expect the metric value on the Ganglia graph to go to zero, whereas it stays at its last updated value. Is there a way to change this behaviour?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

好多鱼好多余 2024-10-28 01:11:09

请注意,在 gmetric 中使用“-d”标志(又名 DMAX)将使 gmond/gmetad 在 DMAX 秒过去而没有 gmetric 更新的情况下完全忘记该指标。

因此,如果您直接开箱即用地运行 Ganglia,则该指标的 .rrd 文件和 Ganglia 图表将完全消失。

如果您想保留指标的 .rrd 历史记录和/或希望 Ganglia 图保持不变(但将绘图降至零),您可以在 /path/to/webserver/ 内编辑对 rrdtool 的调用ganglia/graph.d/metric.php。

查看 CDEF 和 VDEF 的 rrdtool 文档,了解如何将条件合并到 rrdtool 调用中。在这些语句中,我相信您可以检查 .rrd 内最后一个指标的时间戳,然后任意绘制零值(或您想要的任何其他值)。或者,您可以更改您不信任的时间段的线条颜色或样式,等等。rrdtool

相当强大,尽管难以理解。最好仔细阅读的手册页是rrdgraph_data、rrdgraph_graph 和rrdgraph。另请查看 Ganglia 提供的其他一些 PHP 脚本,以了解如何调用 rrdtool 的更多示例。

Note that using the '-d' flag (aka DMAX) in your gmetric will make gmond/gmetad forget about the metric completely after DMAX seconds have passed without a gmetric update.

So if you're running Ganglia straight out of the box, the .rrd file and the Ganglia graph for that metric will disappear entirely.

If you'd like to preserve the .rrd history of the metric and/or you want the Ganglia graph to stay around (but have the plot drop to zero), you could edit the call to rrdtool inside /path/to/webserver/ganglia/graph.d/metric.php.

Check out the rrdtool docs for CDEF and VDEF to see how you can incorporate conditionals into rrdtool calls. Within those statements I believe you can inspect the timestamp of the last metric inside the .rrd and then arbitrarily graph a value of zero (or any other value you want). Alternatively you could change the color or style of the line for time periods that you don't trust, etc., etc.

rrdtool is fairly powerful, if incomprehensible. The best man pages to peruse would be rrdgraph_data, rrdgraph_graph, and rrdgraph. Also check out some of the other PHP scripts provided by Ganglia to see more examples of how to invoke rrdtool.

家住魔仙堡 2024-10-28 01:11:09

我相信这是rrdtool 的一个功能。它将继续显示“最后报告”的值,直到获得新数据。如果您希望指标值变为 0,则必须有一些进程实际报告该指标的 0 值。

尝试在 gmetric 调用中设置 -d 标志。这指示您发送的指标的最大生命周期(以秒为单位)。我相信 gmond/gmetad 会在经过该时间后删除该指标,之后您将不会在 PHP 应用程序中看到它的图表。

这并不完全是您所要求的,但也许这是一个可以接受的选择?

I believe that's a feature of rrdtool. It will continue to show the 'last reported' value until it gets new data. If you wanted a metric value to go to 0, you'd have to have some process which actually reported a 0 value for that metric.

Try setting the -d flag in your gmetric calls. This indicates the maximum lifetime (in seconds) of the metric you send. I believe gmond/gmetad will drop the metric after that amount of time has elapsed, and you won't see it graphed in the PHP app after that.

That isn't exactly what you asked for, but maybe it's an acceptable alternative?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文