Projet

Général

Profil

Révision 614c22df

ID614c22dfe466c3e0e29ae34e5ecf60b57d31deda
Parent 38424614
Enfant d26e6e7d

Ajouté par Danny Fullerton il y a plus de 13 ans

Add ithe byprojects family (vhost AND regex monitoring) to apache and nginx.

Voir les différences:

plugins/apache/apache_byprojects/README.md
1
# The 'byprojects' family
2
Those plugins are used to monitor different projects or vhost (i.e. either different log files or uing regular expression as filters) on the same web server.
3

  
4
## munin_byprojects_access
5
Count the number of hits per projects/vhost.  
6
![byproject_access](https://www.mantor.org/~northox/misc/munin-plugins/nginx_byprojects_access1-month.png "byproject_access")
7

  
8
## munin_byprojects_bandwidth
9
Count the total bandwidth used by each projects/vhost. [Logtail] (https://www.fourmilab.ch/webtools/logtail/) is required.
10
![byproject_bandwidth](https://www.mantor.org/~northox/misc/munin-plugins/apache_byprojects_bandwidth-month.png "byproject_bandwidth")
11

  
12
## munin_byprojects_inout_bandwidth
13
Counts the in/out bandwidth used by each projects/vhost. [Logtail] (https://www.fourmilab.ch/webtools/logtail/) is required.
14
![byproject_inout_bandwidth](https://www.mantor.org/~northox/misc/munin-plugins/apache_byprojects_inout_bandwidth-month.png "byproject_inout_bandwidth")
15

  
16
## Installation
17
Installation is pretty straight forward. First you need to configure the plugin:
18

  
19
Identify the file which will be used by logtail to identify it's position in the log and the path to logtail:
20

  
21
      $statepath = '/usr/local/var/munin/plugin-state'; # directory where logtail will save the state
22
      $logtail = '/usr/local/bin/logtail';
23

  
24
Multiple logs can be used for the same project/vhost and a regular expression (regex) can be used as a filter:
25

  
26
      %logs = (
27
      'prod' => ('/home/prod/log/access.log'),
28
      'test' => (
29
                  ('/var/log/httpd/access.log', '"[A-Z]+ /test/'),
30
                  '/home/test/log/access.log'
31
                )
32
      );
33

  
34
In the previous example the prod project graph will be using everything in /home/prod/log/access.log. The test project will be using eveything in /home/test/log/access.log and stuff that match '"[A-Z] /test/' in /var/log/httpd/access.log (e.g. "GET /test/).
35

  
36
Then link the file just as any other plugins.
plugins/apache/apache_byprojects/byprojects_access
1
#!/usr/bin/perl -w
2
#
3
# byprojects_access
4
#
5
# Perl script to monitor access *byprojects* (e.g. vhost) from multiple files and/or regex.
6
#
7
# Danny Fullerton <northox@mantor.org> 
8
# Mantor Organization <www.mantor.org>
9
# This work is licensed under a Creative Commons Attribution 3.0 Unported License.
10
#
11
# You need logtail (https://www.fourmilab.ch/webtools/logtail/)
12
#
13
# Log can be gather from multiple sources by simply specifying multiple log filename and/or an array with two
14
# elements: log filename and a regex.
15
#   - 'prod' => array('/home/prod/log/access.log'),
16
#     Prod graph will be using everything in /home/prod/log/access.log
17
#   - 'test' => array(array('/var/log/httpd/access.log', '"[A-Z]+ /test/'), '/home/test/log/access.log')
18
#     Test graph will be using eveything in /home/test/log/access.log and stuff that match '"[A-Z] /test/' in 
19
#     /var/log/httpd/access.log such as '"GET /test/'
20

  
21
$server = 'Apache';
22

  
23
$statepath = '/usr/local/var/munin/plugin-state'; # where logtail will save the state
24
$logtail = '/usr/local/bin/logtail';
25

  
26
%logs = (
27
'prod' => ('/home/prod/log/access.log'),
28
'test' => (
29
            ('/var/log/httpd/access.log', '"[A-Z]+ /test/'),
30
            '/home/test/log/access.log'
31
          )
32
);
33

  
34
###########
35

  
36
if(defined($ARGV[0])) {
37
  if ($ARGV[0] eq 'autoconf') {
38
    print "yes\n";
39
    exit(0);
40
  } elsif ($ARGV[0] eq 'config') {
41
    $order = '';
42
    while (($client, $files) = each(%logs)) { $order .= $client.' ' }
43
    print "graph_order $order\n";
44
    print "graph_title $server access byprojects\n";
45
    print "graph_total Total\n";
46
    print "graph_vlabel Access by \${graph_period}\n";
47
    print "graph_category $server\n";
48
    print "graph_info This graph show $server access by various projects.\n";
49
    while (($client, $files) = each(%logs)) {
50
      print $client.".label $client\n";
51
      print $client.".type DERIVE\n";
52
      print $client.".min 0\n";
53
    }
54
    exit(0);
55
  }
56
}
57

  
58
while (($client, $files) = each(%logs)) {
59
  $x = $i = 0;
60
  foreach $file ($files) {
61
    $regex = '';
62
    $state = $statepath.'/'.$client.$x.'_access.state';
63
    if(ref($file) eq 'ARRAY') { ($file, $regex) = @file }
64
    open(my $lt, "$logtail -f $file -o $state |") or die "Can't open $logtail : $!";
65
    while (<$lt>) {
66
      $buf = $_;
67
      if($buf eq '') { next }
68
      if(!defined($regex) || $buf =~ m/$regex/) {
69
        $i++;
70
      }
71
    }
72
    close($lt);
73
    $x++;
74
  }
75
  print $client.".value $i\n";
76
}
plugins/apache/apache_byprojects/byprojects_bandwidth
1
#!/usr/bin/perl -w
2
#
3
# byprojects_bandwidth
4
#
5
# Perl script to monitor total bandwidth *byprojects* (e.g. vhost) from multiple files and/or regex.
6
#
7
# Danny Fullerton <northox@mantor.org> 
8
# Mantor Organization <www.mantor.org>
9
#
10
# You need logtail (https://www.fourmilab.ch/webtools/logtail/) and
11
#
12
# mod_logio apache module (https://httpd.apache.org/docs/2.0/mod/mod_logio.html).
13
# Your logformat should look like this "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O"
14
# where %I is input and %O is output.
15
#
16
# Log can be gather from multiple sources by simply specifying multiple log filename and/or an array with two
17
# elements: log filename and a regex.
18
#   - 'prod' => array('/home/prod/log/access.log'),
19
#     Prod graph will be using everything in /home/prod/log/access.log
20
#   - 'test' => array(array('/var/log/httpd/access.log', '"[A-Z]+ /test/'), '/home/test/log/access.log')
21
#     Test graph will be using eveything in /home/test/log/access.log and stuff that match '"[A-Z] /test/' in 
22
#     /var/log/httpd/access.log such as '"GET /test/'
23

  
24
$statepath = '/usr/local/var/munin/plugin-state'; # directory where logtail will save the state
25
$logtail = '/usr/local/bin/logtail';
26

  
27
$server = 'Apache';
28

  
29
%logs = (
30
'prod' => ('/home/prod/log/access.log'),
31
'test' => (
32
            ('/var/log/httpd/access.log', '"[A-Z]+ /test/'),
33
            '/home/test/log/access.log'
34
          )
35
);
36

  
37
###########
38

  
39
if(defined($ARGV[0])) {
40
  if ($ARGV[0] eq 'autoconf') {
41
    print "yes\n";
42
    exit(0);
43
  } elsif ($ARGV[0] eq 'config') {
44
    $order = '';
45
    while (($client, $files) = each(%logs)) { $order .= $client.' ' }
46
    print "graph_order $order\n";
47
    print "graph_title $server total bandwidth byprojects\n";
48
    print "graph_total Total\n";
49
    print "graph_vlabel Bits\n";
50
    print "graph_category $server\n";
51
    print "graph_info This graph show $server total bandwidth used by various projects.\n";
52
    while (($client, $files) = each(%logs)) {
53
      print $client.".label $client\n";
54
      print $client.".type GAUGE\n";
55
    }
56
    exit(0);
57
  }
58
}
59

  
60
while (($client, $files) = each(%logs)) {
61
  $i = $o = $x = 0;
62
  foreach $file ($files) {
63
    $regex = '';
64
    $state = $statepath.'/'.$client.$x.'_totalbandwidth.state';
65
    if(ref($file) eq 'ARRAY') { ($file, $regex) = @file }
66
    open(my $lt, "$logtail -f $file -o $state |") or die "Can't open $logtail : $!";
67
    while (<$lt>) {
68
      $buf = $_;
69
      if($buf eq '') { next }
70
      if(!defined($regex) || $buf =~ m/$regex/) {
71
        if($buf =~ m/(\d+) (\d+)$/) {
72
          $i += $1;
73
          $o += $2;
74
        }
75
      }
76
    }
77
    close($lt);
78
    $x++;
79
  }
80
  $x = $i + $o;
81
  print $client.".value $x\n";
82
}
83

  
plugins/apache/apache_byprojects/byprojects_inout_bandwidth
1
#!/usr/bin/perl -w
2
#
3
# byprojects_inout_bandwidth
4
#
5
# Perl script to monitor in/out bandwidth *byprojects* (e.g. vhost) from multiple files and/or regex.
6
#
7
# Danny Fullerton <northox@mantor.org> 
8
# Mantor Organization <www.mantor.org>
9
#
10
# You need logtail (https://www.fourmilab.ch/webtools/logtail/) and 
11
#
12
# Apache:
13
# mod_logio apache module (https://httpd.apache.org/docs/2.0/mod/mod_logio.html).
14
# Your logformat should look like this "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O"
15
# where %I is input and %O is output.
16
#
17
# Log can be gather from multiple sources by simply specifying multiple log filename and/or an array with two
18
# elements: log filename and a regex.
19
#   - 'prod' => array('/home/prod/log/access.log'),
20
#     Prod graph will be using everything in /home/prod/log/access.log
21
#   - 'test' => array(array('/var/log/httpd/access.log', '"[A-Z]+ /test/'), '/home/test/log/access.log')
22
#     Test graph will be using eveything in /home/test/log/access.log and stuff that match '"[A-Z] /test/' in 
23
#     /var/log/httpd/access.log such as '"GET /test/'
24

  
25
$server = 'Apache';
26

  
27
$statepath = '/usr/local/var/munin/plugin-state'; # directory where logtail will save the state
28
$logtail = '/usr/local/bin/logtail';
29

  
30
%logs = (
31
'prod' => ('/home/prod/log/access.log'),
32
'test' => (
33
            ('/var/log/httpd/access.log', '"[A-Z]+ /test/'),
34
            '/home/test/log/access.log'
35
          )
36
);
37

  
38
###########
39

  
40
if(defined($ARGV[0])) {
41
  if ($ARGV[0] eq 'autoconf') {
42
    print "yes\n";
43
    exit(0);
44
  } elsif ($ARGV[0] eq 'config') {
45
    print "graph_title $server in/out bandwidth byprojects\n";
46
    print "graph_args --base 1000\n";
47
    print "graph_vlabel bits per \${graph_period} in (-) / out (+)\n";
48
    print "graph_category $server\n";
49
    print "graph_info This graph show $server in/out bandwidth used by various projects.\n";
50
    while (($client, $files) = each(%logs)) {
51
      print "i".$client.".label $client\n";
52
      print "i".$client.".type GAUGE\n";
53
      print "i".$client.".graph no\n";
54
      print "i".$client.".cdef i".$client.",8,*\n";
55
      print "o".$client.".label $client\n";
56
      print "o".$client.".type GAUGE\n";
57
      print "o".$client.".negative i".$client."\n";
58
      print "o".$client.".cdef o".$client.",8,*\n";
59
    }
60
    exit(0);
61
  }
62
}
63

  
64
while (($client, $files) = each(%logs)) {
65
  $i = $o = $x = 0;
66
  foreach $file ($files) {
67
    $regex = '';
68
    $state = $statepath.'/'.$client.$x.'_inoutbandwidth.state';
69
    if(ref($file) eq 'ARRAY') { ($file, $regex) = @file }
70
    open(my $lt, "$logtail -f $file -o $state |") or die "Can't open $logtail : $!";
71
    while (<$lt>) {
72
      $buf = $_;
73
      if($buf eq '') { next }
74
      if(!defined($regex) || $buf =~ m/$regex/) {
75
        if($buf =~ m/(\d+) (\d+)$/) {
76
          $i += $1;
77
          $o += $2;
78
        }
79
      }
80
    }
81
    close($lt);
82
    $x++;
83
  }
84
  print "i".$client.".value $i\n";
85
  print "o".$client.".value $o\n";
86
}
plugins/nginx/nginx_byprojects/README.md
1
# The 'byprojects' family
2
Those plugins are used to monitor different projects or vhost (i.e. either different log files or uing regular expression as filters) on the same web server.
3

  
4
## munin_byprojects_access
5
Count the number of hits per projects/vhost.  
6
![byproject_access](https://www.mantor.org/~northox/misc/munin-plugins/nginx_byprojects_access1-month.png "byproject_access")
7

  
8
## munin_byprojects_bandwidth
9
Count the total bandwidth used by each projects/vhost. [Logtail] (https://www.fourmilab.ch/webtools/logtail/) is required.
10
![byproject_bandwidth](https://www.mantor.org/~northox/misc/munin-plugins/apache_byprojects_bandwidth-month.png "byproject_bandwidth")
11

  
12
## munin_byprojects_inout_bandwidth
13
Counts the in/out bandwidth used by each projects/vhost. [Logtail] (https://www.fourmilab.ch/webtools/logtail/) is required.
14
![byproject_inout_bandwidth](https://www.mantor.org/~northox/misc/munin-plugins/apache_byprojects_inout_bandwidth-month.png "byproject_inout_bandwidth")
15

  
16
## Installation
17
Installation is pretty straight forward. First you need to configure the plugin:
18

  
19
Identify the file which will be used by logtail to identify it's position in the log and the path to logtail:
20

  
21
      $statepath = '/usr/local/var/munin/plugin-state'; # directory where logtail will save the state
22
      $logtail = '/usr/local/bin/logtail';
23

  
24
Multiple logs can be used for the same project/vhost and a regular expression (regex) can be used as a filter:
25

  
26
      %logs = (
27
      'prod' => ('/home/prod/log/access.log'),
28
      'test' => (
29
                  ('/var/log/httpd/access.log', '"[A-Z]+ /test/'),
30
                  '/home/test/log/access.log'
31
                )
32
      );
33

  
34
In the previous example the prod project graph will be using everything in /home/prod/log/access.log. The test project will be using eveything in /home/test/log/access.log and stuff that match '"[A-Z] /test/' in /var/log/httpd/access.log (e.g. "GET /test/).
35

  
36
Then link the file just as any other plugins.
plugins/nginx/nginx_byprojects/byprojects_access
1
#!/usr/bin/perl -w
2
#
3
# byprojects_access
4
#
5
# Perl script to monitor access *byprojects* (e.g. vhost) from multiple files and/or regex.
6
#
7
# Danny Fullerton <northox@mantor.org> 
8
# Mantor Organization <www.mantor.org>
9
# This work is licensed under a Creative Commons Attribution 3.0 Unported License.
10
#
11
# You need logtail (https://www.fourmilab.ch/webtools/logtail/)
12
#
13
# Log can be gather from multiple sources by simply specifying multiple log filename and/or an array with two
14
# elements: log filename and a regex.
15
#   - 'prod' => array('/home/prod/log/access.log'),
16
#     Prod graph will be using everything in /home/prod/log/access.log
17
#   - 'test' => array(array('/var/log/httpd/access.log', '"[A-Z]+ /test/'), '/home/test/log/access.log')
18
#     Test graph will be using eveything in /home/test/log/access.log and stuff that match '"[A-Z] /test/' in 
19
#     /var/log/httpd/access.log such as '"GET /test/'
20

  
21
$server = 'Nginx';
22

  
23
$statepath = '/usr/local/var/munin/plugin-state'; # where logtail will save the state
24
$logtail = '/usr/local/bin/logtail';
25

  
26
%logs = (
27
'prod' => ('/home/prod/log/access.log'),
28
'test' => (
29
            ('/var/log/httpd/access.log', '"[A-Z]+ /test/'),
30
            '/home/test/log/access.log'
31
          )
32
);
33

  
34
###########
35

  
36
if(defined($ARGV[0])) {
37
  if ($ARGV[0] eq 'autoconf') {
38
    print "yes\n";
39
    exit(0);
40
  } elsif ($ARGV[0] eq 'config') {
41
    $order = '';
42
    while (($client, $files) = each(%logs)) { $order .= $client.' ' }
43
    print "graph_order $order\n";
44
    print "graph_title $server access byprojects\n";
45
    print "graph_total Total\n";
46
    print "graph_vlabel Access by \${graph_period}\n";
47
    print "graph_category $server\n";
48
    print "graph_info This graph show $server access by various projects.\n";
49
    while (($client, $files) = each(%logs)) {
50
      print $client.".label $client\n";
51
      print $client.".type DERIVE\n";
52
      print $client.".min 0\n";
53
    }
54
    exit(0);
55
  }
56
}
57

  
58
while (($client, $files) = each(%logs)) {
59
  $x = $i = 0;
60
  foreach $file ($files) {
61
    $regex = '';
62
    $state = $statepath.'/'.$client.$x.'_access.state';
63
    if(ref($file) eq 'ARRAY') { ($file, $regex) = @file }
64
    open(my $lt, "$logtail -f $file -o $state |") or die "Can't open $logtail : $!";
65
    while (<$lt>) {
66
      $buf = $_;
67
      if($buf eq '') { next }
68
      if(!defined($regex) || $buf =~ m/$regex/) {
69
        $i++;
70
      }
71
    }
72
    close($lt);
73
    $x++;
74
  }
75
  print $client.".value $i\n";
76
}
plugins/nginx/nginx_byprojects/byprojects_bandwidth
1
#!/usr/bin/perl -w
2
#
3
# byprojects_bandwidth
4
#
5
# Perl script to monitor total bandwidth *byprojects* (e.g. vhost) from multiple files and/or regex.
6
#
7
# Danny Fullerton <northox@mantor.org> 
8
# Mantor Organization <www.mantor.org>
9
#
10
# You need logtail (https://www.fourmilab.ch/webtools/logtail/) and
11
#
12
# Your nginx configuration should look like this (i.e. $request_length $body_bytes_sent at the end):
13
#   log_format main  '$remote_addr - $remote_user $time_local "$request" '
14
#                    '$status $body_bytes_sent "$http_referer" '
15
#                    '"$http_user_agent" $request_length $body_bytes_sent';
16
#
17
# Log can be gather from multiple sources by simply specifying multiple log filename and/or an array with two
18
# elements: log filename and a regex.
19
#   - 'prod' => array('/home/prod/log/access.log'),
20
#     Prod graph will be using everything in /home/prod/log/access.log
21
#   - 'test' => array(array('/var/log/httpd/access.log', '"[A-Z]+ /test/'), '/home/test/log/access.log')
22
#     Test graph will be using eveything in /home/test/log/access.log and stuff that match '"[A-Z] /test/' in 
23
#     /var/log/httpd/access.log such as '"GET /test/'
24

  
25
$statepath = '/usr/local/var/munin/plugin-state'; # directory where logtail will save the state
26
$logtail = '/usr/local/bin/logtail';
27

  
28
$server = 'Nginx';
29

  
30
%logs = (
31
'prod' => ('/home/prod/log/access.log'),
32
'test' => (
33
            ('/var/log/httpd/access.log', '"[A-Z]+ /test/'),
34
            '/home/test/log/access.log'
35
          )
36
);
37

  
38
###########
39

  
40
if(defined($ARGV[0])) {
41
  if ($ARGV[0] eq 'autoconf') {
42
    print "yes\n";
43
    exit(0);
44
  } elsif ($ARGV[0] eq 'config') {
45
    $order = '';
46
    while (($client, $files) = each(%logs)) { $order .= $client.' ' }
47
    print "graph_order $order\n";
48
    print "graph_title $server total bandwidth byprojects\n";
49
    print "graph_total Total\n";
50
    print "graph_vlabel Bits\n";
51
    print "graph_category $server\n";
52
    print "graph_info This graph show $server total bandwidth used by various projects.\n";
53
    while (($client, $files) = each(%logs)) {
54
      print $client.".label $client\n";
55
      print $client.".type GAUGE\n";
56
    }
57
    exit(0);
58
  }
59
}
60

  
61
while (($client, $files) = each(%logs)) {
62
  $i = $o = $x = 0;
63
  foreach $file ($files) {
64
    $regex = '';
65
    $state = $statepath.'/'.$client.$x.'_totalbandwidth.state';
66
    if(ref($file) eq 'ARRAY') { ($file, $regex) = @file }
67
    open(my $lt, "$logtail -f $file -o $state |") or die "Can't open $logtail : $!";
68
    while (<$lt>) {
69
      $buf = $_;
70
      if($buf eq '') { next }
71
      if(!defined($regex) || $buf =~ m/$regex/) {
72
        if($buf =~ m/(\d+) (\d+)$/) {
73
          $i += $1;
74
          $o += $2;
75
        }
76
      }
77
    }
78
    close($lt);
79
    $x++;
80
  }
81
  $x = $i + $o;
82
  print $client.".value $x\n";
83
}
84

  
plugins/nginx/nginx_byprojects/byprojects_inout_bandwidth
1
#!/usr/bin/perl -w
2
#
3
# byprojects_inout_bandwidth
4
#
5
# Perl script to monitor in/out bandwidth *byprojects* (e.g. vhost) from multiple files and/or regex.
6
#
7
# Danny Fullerton <northox@mantor.org> 
8
# Mantor Organization <www.mantor.org>
9
#
10
# You need logtail (https://www.fourmilab.ch/webtools/logtail/) and 
11
#
12
# Your nginx configuration should look like this (i.e. $request_length $body_bytes_sent at the end):
13
#   log_format main  '$remote_addr - $remote_user $time_local "$request" '
14
#                    '$status $body_bytes_sent "$http_referer" '
15
#                    '"$http_user_agent" $request_length $body_bytes_sent';
16
#
17
# Log can be gather from multiple sources by simply specifying multiple log filename and/or an array with two
18
# elements: log filename and a regex.
19
#   - 'prod' => array('/home/prod/log/access.log'),
20
#     Prod graph will be using everything in /home/prod/log/access.log
21
#   - 'test' => array(array('/var/log/httpd/access.log', '"[A-Z]+ /test/'), '/home/test/log/access.log')
22
#     Test graph will be using eveything in /home/test/log/access.log and stuff that match '"[A-Z] /test/' in 
23
#     /var/log/httpd/access.log such as '"GET /test/'
24

  
25
$server = 'Nginx';
26

  
27
$statepath = '/usr/local/var/munin/plugin-state'; # directory where logtail will save the state
28
$logtail = '/usr/local/bin/logtail';
29

  
30
%logs = (
31
'prod' => ('/home/prod/log/access.log'),
32
'test' => (
33
            ('/var/log/httpd/access.log', '"[A-Z]+ /test/'),
34
            '/home/test/log/access.log'
35
          )
36
);
37

  
38
###########
39

  
40
if(defined($ARGV[0])) {
41
  if ($ARGV[0] eq 'autoconf') {
42
    print "yes\n";
43
    exit(0);
44
  } elsif ($ARGV[0] eq 'config') {
45
    print "graph_title $server in/out bandwidth byprojects\n";
46
    print "graph_args --base 1000\n";
47
    print "graph_vlabel bits per \${graph_period} in (-) / out (+)\n";
48
    print "graph_category $server\n";
49
    print "graph_info This graph show $server in/out bandwidth used by various projects.\n";
50
    while (($client, $files) = each(%logs)) {
51
      print "i".$client.".label $client\n";
52
      print "i".$client.".type GAUGE\n";
53
      print "i".$client.".graph no\n";
54
      print "i".$client.".cdef i".$client.",8,*\n";
55
      print "o".$client.".label $client\n";
56
      print "o".$client.".type GAUGE\n";
57
      print "o".$client.".negative i".$client."\n";
58
      print "o".$client.".cdef o".$client.",8,*\n";
59
    }
60
    exit(0);
61
  }
62
}
63

  
64
while (($client, $files) = each(%logs)) {
65
  $i = $o = $x = 0;
66
  foreach $file ($files) {
67
    $regex = '';
68
    $state = $statepath.'/'.$client.$x.'_inoutbandwidth.state';
69
    if(ref($file) eq 'ARRAY') { ($file, $regex) = @file }
70
    open(my $lt, "$logtail -f $file -o $state |") or die "Can't open $logtail : $!";
71
    while (<$lt>) {
72
      $buf = $_;
73
      if($buf eq '') { next }
74
      if(!defined($regex) || $buf =~ m/$regex/) {
75
        if($buf =~ m/(\d+) (\d+)$/) {
76
          $i += $1;
77
          $o += $2;
78
        }
79
      }
80
    }
81
    close($lt);
82
    $x++;
83
  }
84
  print "i".$client.".value $i\n";
85
  print "o".$client.".value $o\n";
86
}

Formats disponibles : Unified diff