From 42fd0b1a2c469ab02f736341b3685c6f767edead Mon Sep 17 00:00:00 2001 From: Farhad Shahbazi Date: Tue, 18 Jun 2013 14:59:53 +0200 Subject: [PATCH 1/2] if: one probably wants bit for traffic graphs --- plugins/network/if | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/plugins/network/if b/plugins/network/if index 42d9a2c3..8c1ca36c 100755 --- a/plugins/network/if +++ b/plugins/network/if @@ -10,7 +10,7 @@ if - Multigraph plugin to monitor network wired and wireless interfaces In the general graphs made key fields for each interface, a subsidiary graphs for each interface there are detailed This plugin displays the following charts: -Traffic, bytes +Traffic, bit Traffic, packets Average packet size Interface errors @@ -76,15 +76,15 @@ my $interfaces = {}; # ------------------------ avialable graphs ------------------------- my $graphs = { - 'if_bytes' => + 'if_bit' => { 'munin' => { 'category' => 'network', - 'args' => '--base 1024', - 'title' => ':if: traffic, bytes', - 'vlabel' => 'Bytes in (-) / out (+), avg. per second', - 'info' => 'This graph shows the traffic in bytes of the :if:, averaged value per second from last update' + 'args' => '--base 1000', + 'title' => ':if: traffic, bit', + 'vlabel' => 'Bit in (-) / out (+), avg. per second', + 'info' => 'This graph shows the traffic in bit of the :if:, averaged value per second from last update' }, 'per_if_fields' => [qw(rx_bytes tx_bytes)], 'general_fields' => [qw(rx_bytes tx_bytes)] @@ -290,14 +290,15 @@ my $fields = { 'type' => 'GAUGE', 'draw' => 'LINE1', - 'label' => 'RX bytes', - 'info' => 'RX bytes' + 'label' => 'RX bit', + 'info' => 'RX bit' }, 'source' => { 'type' => 'file', 'location' => $ifpath.'/:if:/statistics/rx_bytes' }, + 'cdef' => '8,*', 'peack_protect' => 'max_interface_bps', 'negative' => { @@ -552,14 +553,15 @@ my $fields = { 'type' => 'GAUGE', 'draw' => 'LINE1', - 'label' => 'TX bytes', - 'info' => 'TX bytes' + 'label' => 'TX bit', + 'info' => 'TX bit' }, 'source' => { 'type' => 'file', 'location' => $ifpath.'/:if:/statistics/tx_bytes' }, + 'cdef' => '8,*', 'peack_protect' => 'max_interface_bps', 'difference' => 'per_secund' }, From 522104afc2b4ad2e98c1058fc2770c5a32798b78 Mon Sep 17 00:00:00 2001 From: Farhad Shahbazi Date: Tue, 18 Jun 2013 15:04:00 +0200 Subject: [PATCH 2/2] Fix interface detection --- plugins/network/if | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/network/if b/plugins/network/if index 8c1ca36c..06af4154 100755 --- a/plugins/network/if +++ b/plugins/network/if @@ -1095,6 +1095,7 @@ sub get_interfaces my $if; while (defined ($if = $ifdir->read)) { + next unless -d "$ifpath/$if"; next if $if =~ m/\./; unless($if =~ m/$include/) {