1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-24 18:07:20 +00:00

Whitespace cleanup

* remove trailing whitespace
* remove empty lines at the end of files
This commit is contained in:
Lars Kruse 2018-08-02 02:03:42 +02:00
parent ef851f0c34
commit 17f784270a
604 changed files with 2927 additions and 2945 deletions

View file

@ -89,20 +89,20 @@ my $graphs =
'per_if_fields' => [qw(rx_bytes tx_bytes)],
'general_fields' => [qw(rx_bytes tx_bytes)]
},
'if_packets' =>
'if_packets' =>
{
'munin' =>
{
'category' => 'network',
'args' => '--base 1000',
'title' => ':if: traffic, packets',
'title' => ':if: traffic, packets',
'vlabel' => 'Packets in (-) / out (+), avg. per second',
'info' => 'This graph shows the traffic in packets of the :if:, averaged value per second from last update'
},
'per_if_fields' => [qw(rx_packets tx_packets rx_compressed tx_compressed rx_dropped tx_dropped multicast)],
'general_fields' => [qw(rx_packets tx_packets)]
},
'if_errors' =>
'if_errors' =>
{
'munin' =>
{
@ -199,12 +199,12 @@ my $graphs =
# {
# 'type' - types:
# 'percent',
# 'full' =>
# 'full' =>
# {
# 'source' => 'interface',
# 'name' => 'bps'
# },
# 'part' =>
# 'part' =>
# {
# 'source' => 'field',
# 'name' => 'tx_bytes'
@ -262,7 +262,7 @@ my $fields =
'difference' => 'count'
},
# --------------------------------------------------------------------------
'multicast' =>
'multicast' =>
{
'munin' =>
{
@ -284,8 +284,8 @@ my $fields =
'difference' => 'per_secund'
},
# --------------------------------------------------------------------------
'rx_bytes' =>
{
'rx_bytes' =>
{
'munin' =>
{
'type' => 'GAUGE',
@ -335,9 +335,9 @@ my $fields =
{
'munin' =>
{
'type' => 'GAUGE',
'draw' => 'LINE1',
'label' => 'CRC errors' ,
'type' => 'GAUGE',
'draw' => 'LINE1',
'label' => 'CRC errors' ,
'info' => 'CRC errors'
},
'source' =>
@ -774,12 +774,12 @@ my $fields =
'calculated' =>
{
'type' => 'percent',
'full' =>
'full' =>
{
'source' => 'interface',
'name' => 'bps'
},
'part' =>
'part' =>
{
'source' => 'field',
'name' => 'rx_bytes'
@ -809,12 +809,12 @@ my $fields =
'calculated' =>
{
'type' => 'percent',
'full' =>
'full' =>
{
'source' => 'interface',
'name' => 'bps'
},
'part' =>
'part' =>
{
'source' => 'field',
'name' => 'tx_bytes'
@ -889,7 +889,7 @@ my $fields =
'peack_protect' => 'packet_size_range'
},
# --------------------------------------------------------------------------
'retries' =>
'retries' =>
{
'munin' =>
{
@ -906,7 +906,7 @@ my $fields =
'difference' => 'count'
},
# --------------------------------------------------------------------------
'nwid' =>
'nwid' =>
{
'munin' =>
{
@ -928,7 +928,7 @@ my $fields =
'difference' => 'count'
},
# --------------------------------------------------------------------------
'misc' =>
'misc' =>
{
'munin' =>
{
@ -945,7 +945,7 @@ my $fields =
'difference' => 'count'
},
# --------------------------------------------------------------------------
'fragment' =>
'fragment' =>
{
'munin' =>
{
@ -967,7 +967,7 @@ my $fields =
'difference' => 'count'
},
# --------------------------------------------------------------------------
'beacon' =>
'beacon' =>
{
'munin' =>
{
@ -984,7 +984,7 @@ my $fields =
'difference' => 'count'
},
# --------------------------------------------------------------------------
'crypt' =>
'crypt' =>
{
'munin' =>
{
@ -1006,7 +1006,7 @@ my $fields =
'difference' => 'count'
},
# --------------------------------------------------------------------------
'rx_wifierr' =>
'rx_wifierr' =>
{
'munin' =>
{
@ -1031,7 +1031,7 @@ my $fields =
}
},
# --------------------------------------------------------------------------
'tx_wifierr' =>
'tx_wifierr' =>
{
'munin' =>
{
@ -1056,13 +1056,13 @@ my $fields =
need_multigraph();
if (defined($ARGV[0]) and ($ARGV[0] eq 'autoconf'))
if (defined($ARGV[0]) and ($ARGV[0] eq 'autoconf'))
{
printf("%s\n", -e $ifpath ? "yes" : "no ($ifpath not exists)");
exit (0);
}
$interfaces = get_interfaces();
if (defined($ARGV[0]) and ($ARGV[0] eq 'config'))
if (defined($ARGV[0]) and ($ARGV[0] eq 'config'))
{
print_config();
exit (0);
@ -1124,7 +1124,7 @@ sub get_interfaces
for (keys %{$interfaces}) { $interfaces->{$_}{'name'} = sprintf("[%${maxlen}s]", $interfaces->{$_}{'name'}); }
}
else { die "$ifpath not exists\n"; }
return $interfaces;
}
@ -1169,7 +1169,7 @@ sub get_peak_range
$range->{'max'} = $interfaces->{$if}{'bps'};
$range->{'min'} = 0;
}
# packets per sec
# packets per sec
elsif($fields->{$field}{'peack_protect'} eq 'max_interface_pps' and defined ($interfaces->{$if}{'bps'}))
{
$range->{'max'} = $interfaces->{$if}{'bps'}/$min_packet_size;
@ -1283,10 +1283,10 @@ sub generate_field
my ($config, $graph_name, $field, $if, $is_general_graph) = @_[0..4];
return '' unless(check_field_avialability($if, $field));
my $field_graph_name = $is_general_graph ? sprintf("%s_%s", $if, $field) : $field;
for my $option (keys %{$fields->{$field}{'munin'}})
for my $option (keys %{$fields->{$field}{'munin'}})
{
next if exists($config->{$graph_name}{'fields'}{$field_graph_name}{$option});
$config->{$graph_name}{'fields'}{$field_graph_name}{$option} = replace_if_template($fields->{$field}{'munin'}{$option}, $interfaces->{$if}{'name'});
$config->{$graph_name}{'fields'}{$field_graph_name}{$option} = replace_if_template($fields->{$field}{'munin'}{$option}, $interfaces->{$if}{'name'});
}
if(exists($fields->{$field}{'cdef'}))
{
@ -1300,13 +1300,13 @@ sub generate_field
{
$up_field = $fields->{$down_field}{'negative'}{'name'};
$up_field_name = $is_general_graph ? sprintf("%s_%s", $if, $up_field) : $up_field;
$config->{$graph_name}{'fields'}{$up_field_name}{'label'} =
$config->{$graph_name}{'fields'}{$up_field_name}{'label'} =
concat_names($fields->{$down_field}{'munin'}{'label'}, $fields->{$up_field}{'munin'}{'label'}, $is_general_graph ? $if : '');
}
elsif($fields->{$down_field}{'negative'}{'type'} eq 'dummy')
{
$up_field_name = $is_general_graph ? sprintf("%s_%s_dummy", $if, $down_field) : sprintf("%s_dummy", $down_field);
$config->{$graph_name}{'fields'}{$up_field_name}{'label'} =
$config->{$graph_name}{'fields'}{$up_field_name}{'label'} =
concat_names($fields->{$down_field}{'munin'}{'label'}, $fields->{$down_field}{'munin'}{'label'}, $is_general_graph ? $if : '');
$config->{$graph_name}{'fields'}{$up_field_name}{'info'} = $fields->{$down_field}{'munin'}{'info'};
}
@ -1344,7 +1344,7 @@ sub generate_graph
{
for my $field (@{$graphs->{$graph}{'general_fields'}})
{
for my $general_if (keys %{$interfaces})
for my $general_if (keys %{$interfaces})
{
my $res_field = generate_field($config, $graph_name, $field, $general_if, 1);
push(@order, $res_field) if $res_field ne '';
@ -1361,9 +1361,9 @@ sub generate_graph
}
if(scalar(@order) > 0)
{
for my $option (keys %{$graphs->{$graph}{'munin'}})
for my $option (keys %{$graphs->{$graph}{'munin'}})
{
$config->{$graph_name}{'graph'}{$option} = replace_if_template($graphs->{$graph}{'munin'}{$option}, $is_general_graph ? 'All interfaces' : $interfaces->{$if}{'name'});
$config->{$graph_name}{'graph'}{$option} = replace_if_template($graphs->{$graph}{'munin'}{$option}, $is_general_graph ? 'All interfaces' : $interfaces->{$if}{'name'});
}
$config->{$graph_name}{'graph'}{'order'} = join(' ', @order); # if scalar(@order) > 1;
unless($is_general_graph)
@ -1378,7 +1378,7 @@ sub generate_graphs
{
my ($config, $graph) = @_[0..1];
generate_graph($config, $graph, '', 1);
for my $if (keys %{$interfaces})
for my $if (keys %{$interfaces})
{
generate_graph($config, $graph, $if, 0);
}
@ -1565,9 +1565,9 @@ sub print_values
for my $field (@{$graphs->{$graph}{'general_fields'}}) {
for my $if (keys %{$interfaces}) {
prepare_value($values, $field, sprintf("%s_%s", $if, $field), $graph, $if, $data, $raw_data, $raw_prev_data); } } }
for my $if (keys %{$interfaces})
for my $if (keys %{$interfaces})
{
for my $graph (keys %{$graphs})
for my $graph (keys %{$graphs})
{
my $graph_name = sprintf("%s.%s", $graph, $if);
for my $field (@{$graphs->{$graph}{'per_if_fields'}})