Projet

Général

Profil

Révision 17f78427

ID17f784270ae966ee9a13e9f5104a5b8f925b639e
Parent ef851f0c
Enfant d4320aea, 5b2396a9

Ajouté par Lars Kruse il y a plus de 7 ans

Whitespace cleanup

  • remove trailing whitespace
  • remove empty lines at the end of files

Voir les différences:

plugins/network/if
89 89
    'per_if_fields'  => [qw(rx_bytes tx_bytes)],
90 90
    'general_fields' => [qw(rx_bytes tx_bytes)]
91 91
  },
92
  'if_packets' => 
92
  'if_packets' =>
93 93
  {
94 94
    'munin' =>
95 95
    {
96 96
      'category' => 'network',
97 97
      'args'     => '--base 1000',
98
      'title'    => ':if: traffic, packets', 
98
      'title'    => ':if: traffic, packets',
99 99
      'vlabel'   => 'Packets in (-) / out (+), avg. per second',
100 100
      'info'     => 'This graph shows the traffic in packets of the :if:, averaged value per second from last update'
101 101
    },
102 102
    'per_if_fields'  => [qw(rx_packets tx_packets rx_compressed tx_compressed rx_dropped tx_dropped multicast)],
103 103
    'general_fields' => [qw(rx_packets tx_packets)]
104 104
  },
105
  'if_errors' => 
105
  'if_errors' =>
106 106
  {
107 107
    'munin' =>
108 108
    {
......
199 199
#         {
200 200
#            'type' - types:
201 201
#               'percent',
202
#                 'full' => 
202
#                 'full' =>
203 203
#                 {
204 204
#                    'source' => 'interface',
205 205
#                    'name' => 'bps'
206 206
#                 },
207
#                 'part' => 
207
#                 'part' =>
208 208
#                 {
209 209
#                   'source' => 'field',
210 210
#                   'name' => 'tx_bytes'
......
262 262
    'difference' => 'count'
263 263
  },
264 264
  # --------------------------------------------------------------------------
265
  'multicast' => 
265
  'multicast' =>
266 266
  {
267 267
    'munin' =>
268 268
    {
......
284 284
    'difference'    => 'per_secund'
285 285
  },
286 286
  # --------------------------------------------------------------------------
287
  'rx_bytes' => 
288
  { 
287
  'rx_bytes' =>
288
  {
289 289
    'munin' =>
290 290
    {
291 291
     'type'  => 'GAUGE',
......
335 335
  {
336 336
    'munin' =>
337 337
    {
338
      'type'  => 'GAUGE', 
339
      'draw'  => 'LINE1', 
340
      'label' => 'CRC errors' , 
338
      'type'  => 'GAUGE',
339
      'draw'  => 'LINE1',
340
      'label' => 'CRC errors' ,
341 341
      'info'  => 'CRC errors'
342 342
    },
343 343
    'source' =>
......
774 774
      'calculated' =>
775 775
      {
776 776
        'type' => 'percent',
777
        'full' => 
777
        'full' =>
778 778
        {
779 779
          'source' => 'interface',
780 780
          'name'   => 'bps'
781 781
        },
782
        'part' => 
782
        'part' =>
783 783
        {
784 784
          'source' => 'field',
785 785
          'name'   => 'rx_bytes'
......
809 809
      'calculated' =>
810 810
      {
811 811
        'type' => 'percent',
812
        'full' => 
812
        'full' =>
813 813
        {
814 814
          'source' => 'interface',
815 815
          'name'   => 'bps'
816 816
        },
817
        'part' => 
817
        'part' =>
818 818
        {
819 819
          'source' => 'field',
820 820
          'name'   => 'tx_bytes'
......
889 889
    'peack_protect' => 'packet_size_range'
890 890
  },
891 891
  # --------------------------------------------------------------------------
892
  'retries' => 
892
  'retries' =>
893 893
  {
894 894
    'munin' =>
895 895
    {
......
906 906
    'difference' => 'count'
907 907
  },
908 908
  # --------------------------------------------------------------------------
909
  'nwid' => 
909
  'nwid' =>
910 910
  {
911 911
    'munin' =>
912 912
    {
......
928 928
    'difference' => 'count'
929 929
  },
930 930
  # --------------------------------------------------------------------------
931
  'misc' => 
931
  'misc' =>
932 932
  {
933 933
    'munin' =>
934 934
    {
......
945 945
    'difference' => 'count'
946 946
  },
947 947
  # --------------------------------------------------------------------------
948
  'fragment' => 
948
  'fragment' =>
949 949
  {
950 950
    'munin' =>
951 951
    {
......
967 967
    'difference' => 'count'
968 968
  },
969 969
  # --------------------------------------------------------------------------
970
  'beacon' => 
970
  'beacon' =>
971 971
  {
972 972
    'munin' =>
973 973
    {
......
984 984
    'difference' => 'count'
985 985
  },
986 986
  # --------------------------------------------------------------------------
987
  'crypt' => 
987
  'crypt' =>
988 988
  {
989 989
    'munin' =>
990 990
    {
......
1006 1006
    'difference' => 'count'
1007 1007
  },
1008 1008
  # --------------------------------------------------------------------------
1009
  'rx_wifierr' => 
1009
  'rx_wifierr' =>
1010 1010
  {
1011 1011
    'munin' =>
1012 1012
    {
......
1031 1031
    }
1032 1032
  },
1033 1033
  # --------------------------------------------------------------------------
1034
  'tx_wifierr' => 
1034
  'tx_wifierr' =>
1035 1035
  {
1036 1036
    'munin' =>
1037 1037
    {
......
1056 1056

  
1057 1057
need_multigraph();
1058 1058

  
1059
if (defined($ARGV[0]) and ($ARGV[0] eq 'autoconf')) 
1059
if (defined($ARGV[0]) and ($ARGV[0] eq 'autoconf'))
1060 1060
{
1061 1061
  printf("%s\n", -e $ifpath ? "yes" : "no ($ifpath not exists)");
1062 1062
  exit (0);
1063 1063
}
1064 1064
$interfaces = get_interfaces();
1065
if (defined($ARGV[0]) and ($ARGV[0] eq 'config')) 
1065
if (defined($ARGV[0]) and ($ARGV[0] eq 'config'))
1066 1066
{
1067 1067
  print_config();
1068 1068
  exit (0);
......
1124 1124
    for (keys %{$interfaces}) { $interfaces->{$_}{'name'} = sprintf("[%${maxlen}s]", $interfaces->{$_}{'name'}); }
1125 1125
  }
1126 1126
  else { die "$ifpath not exists\n"; }
1127
  
1127

  
1128 1128
  return $interfaces;
1129 1129
}
1130 1130

  
......
1169 1169
    $range->{'max'} = $interfaces->{$if}{'bps'};
1170 1170
    $range->{'min'} = 0;
1171 1171
  }
1172
  # packets per sec 
1172
  # packets per sec
1173 1173
  elsif($fields->{$field}{'peack_protect'} eq 'max_interface_pps' and defined ($interfaces->{$if}{'bps'}))
1174 1174
  {
1175 1175
    $range->{'max'} = $interfaces->{$if}{'bps'}/$min_packet_size;
......
1283 1283
  my ($config, $graph_name, $field, $if, $is_general_graph) = @_[0..4];
1284 1284
  return '' unless(check_field_avialability($if, $field));
1285 1285
  my $field_graph_name = $is_general_graph ? sprintf("%s_%s", $if, $field) : $field;
1286
  for my $option (keys %{$fields->{$field}{'munin'}}) 
1286
  for my $option (keys %{$fields->{$field}{'munin'}})
1287 1287
  {
1288 1288
    next if exists($config->{$graph_name}{'fields'}{$field_graph_name}{$option});
1289
    $config->{$graph_name}{'fields'}{$field_graph_name}{$option} = replace_if_template($fields->{$field}{'munin'}{$option}, $interfaces->{$if}{'name'}); 
1289
    $config->{$graph_name}{'fields'}{$field_graph_name}{$option} = replace_if_template($fields->{$field}{'munin'}{$option}, $interfaces->{$if}{'name'});
1290 1290
  }
1291 1291
  if(exists($fields->{$field}{'cdef'}))
1292 1292
  {
......
1300 1300
    {
1301 1301
      $up_field = $fields->{$down_field}{'negative'}{'name'};
1302 1302
      $up_field_name = $is_general_graph ? sprintf("%s_%s", $if, $up_field) : $up_field;
1303
      $config->{$graph_name}{'fields'}{$up_field_name}{'label'} = 
1303
      $config->{$graph_name}{'fields'}{$up_field_name}{'label'} =
1304 1304
        concat_names($fields->{$down_field}{'munin'}{'label'}, $fields->{$up_field}{'munin'}{'label'}, $is_general_graph ? $if : '');
1305 1305
    }
1306 1306
    elsif($fields->{$down_field}{'negative'}{'type'} eq 'dummy')
1307 1307
    {
1308 1308
      $up_field_name = $is_general_graph ? sprintf("%s_%s_dummy", $if, $down_field) : sprintf("%s_dummy", $down_field);
1309
      $config->{$graph_name}{'fields'}{$up_field_name}{'label'} = 
1309
      $config->{$graph_name}{'fields'}{$up_field_name}{'label'} =
1310 1310
        concat_names($fields->{$down_field}{'munin'}{'label'}, $fields->{$down_field}{'munin'}{'label'}, $is_general_graph ? $if : '');
1311 1311
      $config->{$graph_name}{'fields'}{$up_field_name}{'info'} = $fields->{$down_field}{'munin'}{'info'};
1312 1312
    }
......
1344 1344
  {
1345 1345
    for my $field (@{$graphs->{$graph}{'general_fields'}})
1346 1346
    {
1347
      for my $general_if (keys %{$interfaces}) 
1347
      for my $general_if (keys %{$interfaces})
1348 1348
      {
1349 1349
        my $res_field = generate_field($config, $graph_name, $field, $general_if, 1);
1350 1350
        push(@order, $res_field) if $res_field ne '';
......
1361 1361
  }
1362 1362
  if(scalar(@order) > 0)
1363 1363
  {
1364
    for my $option (keys %{$graphs->{$graph}{'munin'}}) 
1364
    for my $option (keys %{$graphs->{$graph}{'munin'}})
1365 1365
    {
1366
      $config->{$graph_name}{'graph'}{$option} = replace_if_template($graphs->{$graph}{'munin'}{$option}, $is_general_graph ? 'All interfaces' : $interfaces->{$if}{'name'}); 
1366
      $config->{$graph_name}{'graph'}{$option} = replace_if_template($graphs->{$graph}{'munin'}{$option}, $is_general_graph ? 'All interfaces' : $interfaces->{$if}{'name'});
1367 1367
    }
1368 1368
    $config->{$graph_name}{'graph'}{'order'} = join(' ', @order); # if scalar(@order) > 1;
1369 1369
    unless($is_general_graph)
......
1378 1378
{
1379 1379
  my ($config, $graph) = @_[0..1];
1380 1380
  generate_graph($config, $graph, '', 1);
1381
  for my $if (keys %{$interfaces}) 
1381
  for my $if (keys %{$interfaces})
1382 1382
  {
1383 1383
    generate_graph($config, $graph, $if, 0);
1384 1384
  }
......
1565 1565
    for my $field (@{$graphs->{$graph}{'general_fields'}})                                                          {
1566 1566
      for my $if (keys %{$interfaces})                                                                            {
1567 1567
        prepare_value($values, $field, sprintf("%s_%s", $if, $field), $graph, $if, $data, $raw_data, $raw_prev_data); } } }
1568
  for my $if (keys %{$interfaces}) 
1568
  for my $if (keys %{$interfaces})
1569 1569
  {
1570
    for my $graph (keys %{$graphs}) 
1570
    for my $graph (keys %{$graphs})
1571 1571
    {
1572 1572
        my $graph_name = sprintf("%s.%s", $graph, $if);
1573 1573
        for my $field (@{$graphs->{$graph}{'per_if_fields'}})

Formats disponibles : Unified diff