Munin(2.0系)で/etc/munin/munin-conf.d/に配置しているconfigに書いてある各サーバのeth0をまとめたグラフを出力する方法。
元々以下のように3台のサーバが定義されていたとする。
[product;server0001] address server0001 use_node_name yes [product;server0002] address server0002 use_node_name yes [product;server0003] address server0003 use_node_name yes
この3台をdraw STACK
とsum
を使ってまとめる。
[product;total-eth0-api] update no total_bandwidth.graph_title eth0 total bandwidth total_bandwidth.graph_vlabel bits in (-) / out (+) per ${graph_period} total_bandwidth.graph_category network total_bandwidth.out.draw STACK total_bandwidth.out.label up total_bandwidth.out.sum \ server0001:if_eth0.up \ server0002:if_eth0.up \ server0003:if_eth0.up total_bandwidth.in.draw STACK total_bandwidth.in.label down total_bandwidth.in.sum \ server0001:if_eth0.up \ server0002:if_eth0.up \ server0003:if_eth0.up
上記例はproductという名前のグループに各サーバとまとめたものを配置しているので、各サーバの指定はserver0001のように最後のノード名で問題ない。もしまとめたものを別のグループに配置したり、各サーバが異なるグループに配置されている場合は、各サーバの指定をグループ名からの絶対パスあるいは相対パスで指定する必要がある。
絶対パスの例
[product;api;server0001] address server0001 use_node_name yes [product;api;server0002] address server0002 use_node_name yes [product;db;server0003] address server0003 use_node_name yes [product;total-eth0-api] update no total_bandwidth.graph_title eth0 total bandwidth total_bandwidth.graph_vlabel bits in (-) / out (+) per ${graph_period} total_bandwidth.graph_category network total_bandwidth.out.draw STACK total_bandwidth.out.label up total_bandwidth.out.sum \ product;api;server0001:if_eth0.up \ product;api;server0002:if_eth0.up \ product;db;server0003:if_eth0.up total_bandwidth.in.draw STACK total_bandwidth.in.label down total_bandwidth.in.sum \ product;api;server0001:if_eth0.up \ product;api;server0002:if_eth0.up \ product;db;server0003:if_eth0.up
相対パスの例(まとめのグラフも各サーバもproductまでは同じなので、相対パスでも書ける)
[product;api;server0001] address server0001 use_node_name yes [product;api;server0002] address server0002 use_node_name yes [product;db;server0003] address server0003 use_node_name yes [product;total-eth0-api] update no total_bandwidth.graph_title eth0 total bandwidth total_bandwidth.graph_vlabel bits in (-) / out (+) per ${graph_period} total_bandwidth.graph_category network total_bandwidth.out.draw STACK total_bandwidth.out.label up total_bandwidth.out.sum \ api;server0001:if_eth0.up \ api;server0002:if_eth0.up \ db;server0003:if_eth0.up total_bandwidth.in.draw STACK total_bandwidth.in.label down total_bandwidth.in.sum \ api;server0001:if_eth0.up \ api;server0002:if_eth0.up \ db;server0003:if_eth0.up
Copyright © 2017 システム開発メモ All Rights Reserved.