如何在慕尼黑获得总带宽图

我有一个基本的默认configuration在我的所有服务器上的munin-node,我想创build一个汇总图表,显示总带宽input/输出http和另一个图表显示所有接口的总带宽input/输出。

[编辑]按照第一次海报build议,我现在在这里;

我正在试图实现一个汇总的上/下为if_eth0服务的graphics

基于FAQ中的细节; http://munin-monitoring.org/wiki/faq#Q:HowdoIusefieldname.sum

和详细的例子; http://munin-monitoring.org/wiki/aggregate_examples

和这个有趣的聚合文章; http://blog.loftninjas.org/2010/04/08/an-evening-with-munin-graph-aggregation/

我有以下在/etc/munin/munin.conf中定义我的主机;

[cirrusj1605.hpl.com] address 19x.xx.xx.205 use_node_name yes [cirrusj1606.hpl.com] address 19x.xx.xx.206 use_node_name yes 

并像这样聚合虚拟主机;

[hpl.com;聚合]更新没有联系人号码

  total_bandwidth.graph_title Aggregated bandwidth total_bandwidth.upload.label upload total_bandwidth.upload.sum \ cirrusj1605.hpl.com:if_eth0:up \ cirrusj1606.hpl.com:if_eth0:up 

如果我尝试手动运行munin-graph,则在生成每个graphics时出现以下错误;

2011/02/24 20:04:39 [RRD ERROR]无法显示/var/www/html/munin/hpl.com/aggregates/total_bandwidth-month.png:无效的rpnexpression式:az1_0,UN,0,az1_0 ,IF ,, +

完整的跟踪如下,任何build议可能是什么问题?

谢谢,T

 > -bash-3.2$ /usr/share/munin/munin-graph --debug > --nofork --nolazy --host aggregates 2011/02/24 20:04:39 [DEBUG] Creating > new lock file > /var/run/munin/munin-graph.lock > 2011/02/24 20:04:39 [DEBUG] Creating > lock : /var/run/munin/munin-graph.lock > succeeded 2011/02/24 20:04:39 Starting > munin-graph 2011/02/24 20:04:39 > [DEBUG] Doing work synchrnonously > 2011/02/24 20:04:39 [DEBUG] Node name: > total_bandwidth 2011/02/24 20:04:39 > [DEBUG] Expanding specials for > total_bandwidth: "upload". 2011/02/24 > 20:04:39 DEBUG: expand_specials > (cirrusj1605.hpl.com:if_eth0:up): > Doing sum... 2011/02/24 20:04:39 > [DEBUG] Checking field lengths for > total_bandwidth: > "z1_0=cirrusj1605.hpl.com:if_eth0:up". > 2011/02/24 20:04:39 [DEBUG] Treating > fields > "z1_0=cirrusj1605.hpl.com:if_eth0:up","upload". > 2011/02/24 20:04:39 [DEBUG] Processing > field "z1_0" [z1_0]. 2011/02/24 > 20:04:39 [PERL WARNING] Use of > uninitialized value in subroutine > entry at > /usr/lib/perl5/vendor_perl/5.8.8/Munin/Master/GraphOld.pm > line 757. 2011/02/24 20:04:39 DEBUG: > single_value: Checking field "z1_0". > 2011/02/24 20:04:39 DEBUG: > single_value: Checking field "upload". > 2011/02/24 20:04:39 [DEBUG] service > hpl.com :: aggregates :: > total_bandwidth has 2 elements. > 2011/02/24 20:04:39 [PERL WARNING] Use > of uninitialized value in > concatenation (.) or string at > /usr/lib/perl5/vendor_perl/5.8.8/Munin/Master/GraphOld.pm > line 774. 2011/02/24 20:04:39 [DEBUG] > RRD name / filename: z1_0 / 2011/02/24 > 20:04:39 [PERL WARNING] Use of > uninitialized value in concatenation > (.) or string at > /usr/lib/perl5/vendor_perl/5.8.8/Munin/Master/GraphOld.pm > line 783. 2011/02/24 20:04:39 [PERL > WARNING] Use of uninitialized value in > concatenation (.) or string at > /usr/lib/perl5/vendor_perl/5.8.8/Munin/Master/GraphOld.pm > line 785. 2011/02/24 20:04:39 [PERL > WARNING] Use of uninitialized value in > concatenation (.) or string at > /usr/lib/perl5/vendor_perl/5.8.8/Munin/Master/GraphOld.pm > line 786. 2011/02/24 20:04:39 [DEBUG] > Field name after cdef set to cdefz1_0 > 2011/02/24 20:04:39 [DEBUG] Drawing > field "z1_0". 2011/02/24 20:04:39 > > rrdtool 'graph' '--font' \ > 'LEGEND:7:/usr/share/fonts/bitstream-vera/VeraMono.ttf' > \ > '--font' \ > 'UNIT:7:/usr/share/fonts/bitstream-vera/VeraMono.ttf' > \ > '--font' \ > 'AXIS:7:/usr/share/fonts/bitstream-vera/VeraMono.ttf' > \ > '-W' \ > 'Munin 1.4.5' \ > '/var/www/html/munin/hpl.com/aggregates/total_bandwidth-month.png' > \ > '--title' \ > 'Aggregated bandwidth - by month' \ > '--start' \ > '-33d' \ > '--height' \ > '175' \ > '--width' \ > '400' \ > '--imgformat' \ > 'PNG' \ > 'DEF:az1_0=:42:MAX' \ > 'DEF:iz1_0=:42:MIN' \ > 'DEF:gz1_0=:42:AVERAGE' \ > 'CDEF:acdefz1_0=az1_0,UN,0,az1_0,IF,,+' > \ > 'CDEF:icdefz1_0=iz1_0,UN,0,iz1_0,IF,,+' > \ > 'CDEF:gcdefz1_0=gz1_0,UN,0,gz1_0,IF,,+' > \ > 'CDEF:ccdefz1_0=gcdefz1_0' \ > 'COMMENT: ' \ > 'COMMENT: Cur\:' \ > 'COMMENT:Min\:' \ > 'COMMENT:Avg\:' \ > 'COMMENT:Max\: \j' \ > 'LINE1.6:gcdefz1_0#00CC00:upload ' \ > 'GPRINT:ccdefz1_0:LAST:%6.2lf%s' \ > 'GPRINT:icdefz1_0:MIN:%6.2lf%s' \ > 'GPRINT:gcdefz1_0:AVERAGE:%6.2lf%s' \ > 'GPRINT:acdefz1_0:MAX:%6.2lf%s\j' \ > 'COMMENT:Last update\: Wed Dec 31 16\:00\:00 1969\r' 2011/02/24 20:04:39 > [RRD ERROR] Unable to graph > /var/www/html/munin/hpl.com/aggregates/total_bandwidth-month.png > : invalid rpn expression in: > az1_0,UN,0,az1_0,IF,,+ 2011/02/24 > 20:04:39 > > rrdtool 'graph' '--font' \ > 'LEGEND:7:/usr/share/fonts/bitstream-vera/VeraMono.ttf' > \ > '--font' \ > 'UNIT:7:/usr/share/fonts/bitstream-vera/VeraMono.ttf' > \ > '--font' \ > 'AXIS:7:/usr/share/fonts/bitstream-vera/VeraMono.ttf' > \ > '-W' \ > 'Munin 1.4.5' \ > '/var/www/html/munin/hpl.com/aggregates/total_bandwidth-week.png' > \ > '--title' \ > 'Aggregated bandwidth - by week' \ > '--start' \ > '-8d' \ > '--height' \ > '175' \ > '--width' \ > '400' \ > '--imgformat' \ > 'PNG' \ > 'DEF:az1_0=:42:MAX' \ > 'DEF:iz1_0=:42:MIN' \ > 'DEF:gz1_0=:42:AVERAGE' \ > 'CDEF:acdefz1_0=az1_0,UN,0,az1_0,IF,,+' > \ > 'CDEF:icdefz1_0=iz1_0,UN,0,iz1_0,IF,,+' > \ > 'CDEF:gcdefz1_0=gz1_0,UN,0,gz1_0,IF,,+' > \ > 'CDEF:ccdefz1_0=gcdefz1_0' \ > 'COMMENT: ' \ > 'COMMENT: Cur\:' \ > 'COMMENT:Min\:' \ > 'COMMENT:Avg\:' \ > 'COMMENT:Max\: \j' \ > 'LINE1.6:gcdefz1_0#00CC00:upload ' \ > 'GPRINT:ccdefz1_0:LAST:%6.2lf%s' \ > 'GPRINT:icdefz1_0:MIN:%6.2lf%s' \ > 'GPRINT:gcdefz1_0:AVERAGE:%6.2lf%s' \ > 'GPRINT:acdefz1_0:MAX:%6.2lf%s\j' \ > 'COMMENT:Last update\: Wed Dec 31 16\:00\:00 1969\r' 2011/02/24 20:04:39 > [RRD ERROR] Unable to graph > /var/www/html/munin/hpl.com/aggregates/total_bandwidth-week.png > : invalid rpn expression in: > az1_0,UN,0,az1_0,IF,,+ 2011/02/24 > 20:04:39 > > rrdtool 'graph' '--font' \ > 'LEGEND:7:/usr/share/fonts/bitstream-vera/VeraMono.ttf' > \ > '--font' \ > 'UNIT:7:/usr/share/fonts/bitstream-vera/VeraMono.ttf' > \ > '--font' \ > 'AXIS:7:/usr/share/fonts/bitstream-vera/VeraMono.ttf' > \ > '-W' \ > 'Munin 1.4.5' \ > '/var/www/html/munin/hpl.com/aggregates/total_bandwidth-day.png' > \ > '--title' \ > 'Aggregated bandwidth - by day' \ > '--start' \ > '-30h' \ > '--height' \ > '175' \ > '--width' \ > '400' \ > '--imgformat' \ > 'PNG' \ > 'DEF:az1_0=:42:MAX' \ > 'DEF:iz1_0=:42:MIN' \ > 'DEF:gz1_0=:42:AVERAGE' \ > 'CDEF:acdefz1_0=az1_0,UN,0,az1_0,IF,,+' > \ > 'CDEF:icdefz1_0=iz1_0,UN,0,iz1_0,IF,,+' > \ > 'CDEF:gcdefz1_0=gz1_0,UN,0,gz1_0,IF,,+' > \ > 'CDEF:ccdefz1_0=gcdefz1_0' \ > 'COMMENT: ' \ > 'COMMENT: Cur\:' \ > 'COMMENT:Min\:' \ > 'COMMENT:Avg\:' \ > 'COMMENT:Max\: \j' \ > 'LINE1.6:gcdefz1_0#00CC00:upload ' \ > 'GPRINT:ccdefz1_0:LAST:%6.2lf%s' \ > 'GPRINT:icdefz1_0:MIN:%6.2lf%s' \ > 'GPRINT:gcdefz1_0:AVERAGE:%6.2lf%s' \ > 'GPRINT:acdefz1_0:MAX:%6.2lf%s\j' \ > 'COMMENT:Last update\: Wed Dec 31 16\:00\:00 1969\r' 2011/02/24 20:04:39 > [RRD ERROR] Unable to graph > /var/www/html/munin/hpl.com/aggregates/total_bandwidth-day.png > : invalid rpn expression in: > az1_0,UN,0,az1_0,IF,,+ 2011/02/24 > 20:04:39 > > rrdtool 'graph' '--font' \ > 'LEGEND:7:/usr/share/fonts/bitstream-vera/VeraMono.ttf' > \ > '--font' \ > 'UNIT:7:/usr/share/fonts/bitstream-vera/VeraMono.ttf' > \ > '--font' \ > 'AXIS:7:/usr/share/fonts/bitstream-vera/VeraMono.ttf' > \ > '-W' \ > 'Munin 1.4.5' \ > '/var/www/html/munin/hpl.com/aggregates/total_bandwidth-year.png' > \ > '--title' \ > 'Aggregated bandwidth - by year' \ > '--start' \ > '-400d' \ > '--height' \ > '175' \ > '--width' \ > '400' \ > '--imgformat' \ > 'PNG' \ > 'DEF:az1_0=:42:MAX' \ > 'DEF:iz1_0=:42:MIN' \ > 'DEF:gz1_0=:42:AVERAGE' \ > 'CDEF:acdefz1_0=az1_0,UN,0,az1_0,IF,,+' > \ > 'CDEF:icdefz1_0=iz1_0,UN,0,iz1_0,IF,,+' > \ > 'CDEF:gcdefz1_0=gz1_0,UN,0,gz1_0,IF,,+' > \ > 'CDEF:ccdefz1_0=gcdefz1_0' \ > 'COMMENT: ' \ > 'COMMENT: Cur\:' \ > 'COMMENT:Min\:' \ > 'COMMENT:Avg\:' \ > 'COMMENT:Max\: \j' \ > 'LINE1.6:gcdefz1_0#00CC00:upload ' \ > 'GPRINT:ccdefz1_0:LAST:%6.2lf%s' \ > 'GPRINT:icdefz1_0:MIN:%6.2lf%s' \ > 'GPRINT:gcdefz1_0:AVERAGE:%6.2lf%s' \ > 'GPRINT:acdefz1_0:MAX:%6.2lf%s\j' \ > 'COMMENT:Last update\: Wed Dec 31 16\:00\:00 1969\r' 2011/02/24 20:04:39 > [RRD ERROR] Unable to graph > /var/www/html/munin/hpl.com/aggregates/total_bandwidth-year.png > : invalid rpn expression in: > az1_0,UN,0,az1_0,IF,,+ 2011/02/24 > 20:04:39 Graphed service : > total_bandwidth (0.01 sec * 4) > 2011/02/24 20:04:39 Munin-graph > finished (0.11 sec) 

是的,它是通过创build一个组合图在服务器端完成的。

基本上这是通过在munin服务器configuration( munin.conf )中描述一个新的图来完成的,其中数据图是两个数据源的总和:

 [some.machine.boo] total_http_bw.graph_order total_received total_http_bw.graph_title HTTP traffic recived by machine1 and machine2 total_http_bw.graph_vlabel Kb/s total_http_bw.total_received.label HTTP received traffic total_http_bw.total_received.sum \ machine1.machine.boo:http_bw:received \ machine2.machine.boo:http_bw:received 

您可以在munin网站上find堆叠的示例(在另一个上面绘制两个数据源)。 如果要绘制两个数据源的总和,则可以使用total_received.sum函数而不是total_received.stack

ive添加了这个答案所需的networking接口带宽的节,因为它使原来的问题更完整的答案(我不能select2正确的答案等)

我有很多麻烦,让networking接口放弃他们的价值作为一个总和,所以这是大量的随机试验和错误变化的最终结果,以获得一个SUM线图多个munin节点

  [mydomain.com;aggregates] total_bandwidth.graph_args --base 1000 -l 0 total_bandwidth.cdef 0 total_bandwidth.graph_category Network total_bandwidth.graph_title Aggregated bandwidth total_bandwidth.graph_vlabel Bits/sec total_bandwidth.upload.label upload total_bandwidth.total.graph yes total_bandwidth.upload.sum \ mybox1.mydomain.com:if_eth0.up \ mybox2.mydomain.com:if_eth0.up total_bandwidth.upload.type COUNTER total_bandwidth.download.type COUNTER total_bandwidth.download.label download total_bandwidth.graph_order upload download total_bandwidth.total.graph no total_bandwidth.download.sum \ mybox1.mydomain.com:if_eth0.down \ mybox2.mydomain.com:if_eth0.down 

我怀疑这些指令中有一些是不必要的或者是错误的,但是我希望这是任何试图达到这个目标的人的一个起点。

我也怀疑,如果你明确地确定所有的主机都在聚合组中,比如说mydomain.com,即使你的主机在本地命名不正确,它也会更好,比如hostname -f是错误的