RRDTool:无法绘制线或面积(绘制空)
我一直在尝试掌握 RRDTool。除了数据采集和存储之外,我在绘制任何东西时都遇到了麻烦。
像这样使用它不会返回任何内容,即不会创建 png:
rrdtool graph graph.png --end now --start end-60 DEF:in=teams.rrd:in:AVERAGE LINE2:in#000000
获得任何输出的唯一方法是包含类似 GPRINT 的内容:
rrdtool graph graph.png --end now --start end-60 DEF:in=teams.rrd:in:AVERAGE LINE2:in#000000 GPRINT:in:AVERAGE:"%8.2lf %s Bytes"
但即便如此,图形本身还是空的,而 GPRINT 打印正确的值。我还尝试过绘制恒定值并使用 HRULE,但没有成功。我几乎尝试了所有方法,手动指定开始和结束以及上限和下限。
这是在 Debian Squeeze 和 Ubuntu 11.04 上。
更新:
没关系,我“解决”了我的问题。事实证明它与 shell 扩展有关,在“LINE:in:#000000”周围加上引号就足够了。愚蠢的错误。
I've been trying to get to grips with RRDTool. Aside from the data acquisition and storage, I'm having trouble plotting anything at all.
Using it like this doesn't return anything, i.e. no png is created:
rrdtool graph graph.png --end now --start end-60 DEF:in=teams.rrd:in:AVERAGE LINE2:in#000000
The only way to get any output is to include something like GPRINT:
rrdtool graph graph.png --end now --start end-60 DEF:in=teams.rrd:in:AVERAGE LINE2:in#000000 GPRINT:in:AVERAGE:"%8.2lf %s Bytes"
But even then, the graph itself is empty, while the GPRINT prints the correct value. I've also tried my luck with plotting a constant value and using HRULE, to no avail. I've tried pretty much everything, manually specifying start and end as well as upper and lower limits.
This is on Debian Squeeze and Ubuntu 11.04.
Update:
Nevermind, I "solved" my problem. Turns out it had something to do with shell-expansion, and putting quotes around the "LINE:in:#000000" was sufficient. Stupid mistake.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论