X-Git-Url: https://git.hcoop.net/hcoop/scripts.git/blobdiff_plain/63ecf1966655d05b276abb37239b676f8f6d8dbb..6d76f213ad5eb330ae20be4ace45ab27ff6e4268:/quotacheck diff --git a/quotacheck b/quotacheck index 4145294..d4cb912 100755 --- a/quotacheck +++ b/quotacheck @@ -9,10 +9,9 @@ # and Database volumes. We use quotas to keep the shop clean, not # to impose restrictions). -# Script retrieves volume info from deleuze, from there it -# reads mail., user. and db. volumes into %vol, then -# sees which volumes have > $threshold usage, relative to volume -# quota. +# Script retrieves volume info from the afs server, from there it +# reads mail., user. and db. volumes into %vol, then sees which +# volumes have > $threshold usage, relative to volume quota. # # For volumes above threshold, it extracts the owner name from # volume name (like, mail.USERNAME) and saves info to %warn. @@ -55,13 +54,13 @@ use Data::Dumper qw/Dumper/; # Warn threshold our %threshold = ( user => 0.8, mail => 0.6, db => 0.4 ); # AFS servers with volumes -our @servers = qw/deleuze/; +our @servers = qw/gibran/; # Which volumes we want? # (Your volumes need to be in format (TYPE).USERNAME, otherwise # you will have to modify below where we take .USERNAME to mean # person's USERNAME). Changing this will also trigger changes # in template email (see DATA below). -our $volume_pattern = '(mail|user|db)\.[a-zA-Z0-9]+'; # implicit ^...$ +our $volume_pattern = '(mail|user)\.[a-zA-Z0-9]+'; # implicit ^...$ # Cache file our $statefile = '/var/cache/hcoop/quotacheck'; # Hash structure containing load of $statefile @@ -238,7 +237,7 @@ sub email_notify { $_ =~ s/\$CRIT{(\w+)}/$warn{$user}{$1} ? " (APPROACHING QUOTA)" : ""/mge; } #print join('', @msg); - open(MAIL, "| mail -s 'Approaching quota limit at HCoop' -a 'From: admins\@hcoop.net' -b 'docelic' '$user\@hcoop.net'"); + open(MAIL, "| mail -s 'Approaching quota limit at HCoop' -a 'From: admins\@hcoop.net' -b 'admins\@hcoop.net' '$user\@hcoop.net'"); { no warnings; print main::MAIL join('', @msg); } close MAIL; } @@ -303,12 +302,6 @@ Mail: threshold=$threshold{mail} use=$warn{mail} $CRIT{mail} -Databases: - size=$vol{db}{diskused} KB - quota=$vol{db}{maxquota} KB - threshold=$threshold{db} - use=$warn{db} $CRIT{db} - Please submit your disk quota increase request in a timely manner at: