LoginSignup
0
0

More than 5 years have passed since last update.

munin pluginの書き方Tips

Posted at

negative graphの書き方

ethernet I/F のトラフィック状況表示の様に「0基準で上下(-/+)」にグラフ表示させる

例えばこんなの
スクリーンショット 2017-04-07 01.30.05.png

test.pl
if ($ARGV[0] and $ARGV[0] eq "config") {
   print "plus.type GAUGE\n";
   print "plus.min 0\n";
   print "plus.draw LINE1\n";
   print "plus.info Net Out\n";
   print "plus.label bps\n";
   print "minus.info Net In\n";
   print "minus.label bps\n";
   print "minus.graph no\n";
   print "plus.negative minus\n";
} else {
   print "plus.value " . $out . "\n";
   print "minus.value " . $in . "\n";
}

- negative の使い方

print "minus.graph no\n";
print "plus.negative minus\n";
呪文を唱えるように「プラス値label名.nagative マイナス値label名」が必至である

  • ラベル表示を合わせよう

print "plus.label bps\n";
print "minus.label bps\n";
ラベル表示内容は同一で!

注意点としては for文 などを使って label名 を配列などから持ってくる際には分岐をきちんと行い「不要なlabel」を出力しない必要性がある(最初に出力したlabel名が有効になるためコードを端折るとハマります

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0