将 RRD 数据导入 Python 数据结构
有谁有将rrd数据导入python的好方法吗?到目前为止,我找到的唯一库只是命令行的包装器或提供将数据导入到 rrd 并绘制图表的功能。
我知道 rrd 的导出和转储选项,但我想知道是否有人已经在这里完成了繁重的工作。
Does anyone have a good method for importing rrd data into python? The only libraries I have found so far are just wrappers for the command line or provide importing data into rrd and graphing it.
I am aware of the export and dump options of rrd, but I am wondering if someone has already done the heavy lifting here.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是我为获取 cacti rrd 数据而编写的脚本的摘录。它不太可能正是您想要的,但它可能会给您一个良好的开始。我的脚本的目的是将 Cacti 转变为数据仓库,因此我倾向于提取大量平均值、最大值或最小值数据。我还有一些用于抛出上限或下限范围峰值的标志,如果我想将“字节/秒”转换为更可用的值,例如“mb/小时”...
如果您想要精确的一对一数据复制,您可能需要稍微调整一下。
Here's an excerpt from a script that I wrote to get cacti rrd data out. It's not likely to be exactly what you want, but it might give you a good start. The intent of my script is to turn Cacti into a data warehouse, so I tend to pull out a lot of averages, max, or min data. I also have some flags for tossing upper or lower range spikes, multiplying in case I want to turn "bytes/sec" into something more usable, like "mb/hour"...
If you want exact one-to-one data copy, you might need to tweak this a bit.