Changeset 2900 for Serveur


Ignore:
Timestamp:
01/26/10 16:35:46 (9 years ago)
Author:
kent1
Message:

Modification des entêtes pour être correct pour l'aide

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Serveur/munin/sympa4munin/sympa_stats

    r2898 r2900  
    66# Heavily based on exim_mailstats
    77#
    8 # Usage: copy or link into /etc/munin/node.d/
     8# Usage: copy or link into /etc/munin/plugins/
    99#
    1010# Parameters:
     
    2222#%# family=auto
    2323#%# capabilities=autoconf
    24 
     24#
     25# Example of /etc/munin/plugin-conf.d/munin-node configuration
     26# [sympa_stats]
     27# user root
     28#
     29# root is needed to read syslog
    2530
    2631my $statefile = "/var/lib/munin/plugin-state/plugin-sympa_stats.state";
     
    3338my $msgAccepted = 0;
    3439my $msgArchived = 0;
    35 $pos = 0; 
     40$pos = 0;
    3641my $logfile = $ENV{'logfile'} || '/var/log/syslog';
    3742my $rotlogfile = '';
     
    7984    print "graph_scale  no\n";
    8085    print "graph_category sympa\n";
    81    
     86
    8287    print "badFiles.label bad Files\n";
    8388    print "badFiles.type DERIVE\n";
    8489    print "badFiles.min 0\n";
    85    
     90
    8691    print "oldFiles.label old Files\n";
    8792    print "oldFiles.type DERIVE\n";
    8893    print "oldFiles.min 0\n";
    89    
     94
    9095    print "senderNotAllowed.label rejected\n";
    9196    print "senderNotAllowed.type DERIVE\n";
    9297    print "senderNotAllowed.min 0\n";
    93    
     98
    9499    print "keyToEditors.label keyToEditors\n";
    95100    print "keyToEditors.type DERIVE\n";
    96101    print "keyToEditors.min 0\n";
    97    
     102
    98103    print "msgAccepted.label msgAccepted\n";
    99104    print "msgAccepted.type DERIVE\n";
    100105    print "msgAccepted.min 0\n";
    101    
     106
    102107    print "msgArchived.label msgArchived\n";
    103108    print "msgArchived.type DERIVE\n";
    104109    print "msgArchived.min 0\n";
    105110
    106    
     111
    107112    exit 0;
    108113}
     
    152157print "senderNotAllowed.value $senderNotAllowed\n";
    153158print "keyToEditors.value $keyToEditors\n";
    154 print "msgAccepted.value $msgAccepted\n"; 
     159print "msgAccepted.value $msgAccepted\n";
    155160print "msgArchived.value $msgArchived\n";
    156161
     
    159164if(-l $statefile) {
    160165        die("$statefile is a symbolic link, refusing to touch it.");
    161 }                               
     166}
    162167open (OUT, ">$statefile") or exit 4;
    163168print OUT "$pos:$badFiles:$oldFiles:$senderNotAllowed:$keyToEditors:$msgAccepted:$msgArchived\n";
    164169close OUT;
    165170
    166 sub parseLogfile 
    167 {   
     171sub parseLogfile
     172{
    168173    my ($fname, $start, $stop) = @_;
    169174    open (LOGFILE, $fname) or exit 3;
    170175    seek (LOGFILE, $start, 0) or exit 2;
    171     while (tell (LOGFILE) < $stop) 
     176    while (tell (LOGFILE) < $stop)
    172177    {
    173178        my $line =<LOGFILE>;
     
    175180        chomp ($line);
    176181
    177         if ($line=~/Moving bad file \S+ to bad/) 
     182        if ($line=~/Moving bad file \S+ to bad/)
    178183        {
    179184            $badFiles++;
    180         } 
     185        }
    181186        elsif ($line=~/Deleting old file /)
    182187        {
     
    195200            $msgAccepted++;
    196201        }
    197         elsif ($line=~/Archiving \S+ for list/) 
     202        elsif ($line=~/Archiving \S+ for list/)
    198203        {
    199204            $msgArchived++;
    200205        }
    201206
    202        
     207
    203208    }
    204     close(LOGFILE);   
     209    close(LOGFILE);
    205210}
    206211
Note: See TracChangeset for help on using the changeset viewer.