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/nginx/nginx_byprojects/byprojects_inout_bandwidth
4 4
#
5 5
# byprojects_inout_bandwidth
6 6
#
7
# Perl script to monitor in/out bandwidth *byprojects* (e.g. vhost) from 
7
# Perl script to monitor in/out bandwidth *byprojects* (e.g. vhost) from
8 8
# multiple files and/or regex.
9 9
#
10
# Danny Fullerton <northox@mantor.org> 
10
# Danny Fullerton <northox@mantor.org>
11 11
# Mantor Organization <www.mantor.org>
12 12
# This work is licensed under a MIT license.
13 13
#
14 14
# You need logtail (https://www.fourmilab.ch/webtools/logtail/)
15 15
#
16
# Your nginx configuration should look like this (i.e. $request_length 
16
# Your nginx configuration should look like this (i.e. $request_length
17 17
# body_bytes_sent at the end):
18 18
#   log_format main  '$remote_addr - $remote_user $time_local "$request" '
19 19
#                    '$status $body_bytes_sent "$http_referer" '
20 20
#                    '"$http_user_agent" $request_length $body_bytes_sent';
21 21
#
22
# Log can be gathered from multiple sources by simply specifying multiple log 
22
# Log can be gathered from multiple sources by simply specifying multiple log
23 23
# filename or using wildcards (glob). File content can be selected using regex.
24 24
#
25 25
# - 'prod' => [ {'path' => '/home/prod/log/access.log'} ],
......
83 83
    my @paths = glob $log->{'path'};
84 84
    foreach my $path (@paths) {
85 85
      my $state = $statepath.'/'.$project.$x.'_inoutbandwidth.state';
86
      open(LT, "$logtail -f ".$log->{'path'}." -o $state |") or 
86
      open(LT, "$logtail -f ".$log->{'path'}." -o $state |") or
87 87
        die "Can't open $logtail : $!";
88 88
      while (<LT>) {
89 89
        my $buf = $_;

Formats disponibles : Unified diff