root / plugins / other / scalix_indexwork @ 31c7de62
Historique | Voir | Annoter | Télécharger (1010 octets)
| 1 |
#!/usr/bin/perl |
|---|---|
| 2 |
# |
| 3 |
# Plugin to monitor the Scalix email system. |
| 4 |
# |
| 5 |
# $Log$ |
| 6 |
# |
| 7 |
# |
| 8 |
# Parameters: |
| 9 |
# |
| 10 |
# config (required) |
| 11 |
# autoconf (optional - used by munin-config) |
| 12 |
# |
| 13 |
# Magic markers (Used by munin-config and some installation scripts. |
| 14 |
# Optional): |
| 15 |
# |
| 16 |
#%# family=contrib |
| 17 |
|
| 18 |
my $OMRP="/opt/scalix/bin/omrealpath"; |
| 19 |
|
| 20 |
my $mode = shift; |
| 21 |
|
| 22 |
if($mode eq "config") {
|
| 23 |
print "graph_title Scalix Index Work Queue\n"; |
| 24 |
print "graph_args -l 0\n"; |
| 25 |
print "graph_vlabel number\n"; |
| 26 |
print "graph_category Scalix\n"; |
| 27 |
print "graph_title Scalix Index Work Queue\n"; |
| 28 |
print "graph_vlabel Items\n"; |
| 29 |
print "items.label Items to be indexed\n"; |
| 30 |
print "items.min 0\n"; |
| 31 |
exit 0; |
| 32 |
} |
| 33 |
|
| 34 |
my $iwdir = `$OMRP "~/indexwork"`; chomp $iwdir; |
| 35 |
#print "$iwdir\n"; |
| 36 |
|
| 37 |
my ($f, $fsize, $i); |
| 38 |
|
| 39 |
opendir(DIR, $iwdir); |
| 40 |
while ($f = readdir(DIR)) {
|
| 41 |
next unless $f =~ /\d+\.\d/; |
| 42 |
$fsize = -s $iwdir . '/' . $f; |
| 43 |
# print "$f $fsize\n"; |
| 44 |
$i += ($fsize / 112); |
| 45 |
} |
| 46 |
closedir(DIR); |
| 47 |
|
| 48 |
$i = int $i; |
| 49 |
|
| 50 |
print "items.value $i\n"; |
