root / plugins / scalix / scalix_indexwork @ 17f78427
Historique | Voir | Annoter | Télécharger (1005 octets)
| 1 | 31c7de62 | Peter Holzleitner | #!/usr/bin/perl |
|---|---|---|---|
| 2 | 17f78427 | Lars Kruse | # |
| 3 | 31c7de62 | Peter Holzleitner | # Plugin to monitor the Scalix email system. |
| 4 | # |
||
| 5 | # $Log$ |
||
| 6 | # |
||
| 7 | # |
||
| 8 | # Parameters: |
||
| 9 | 17f78427 | Lars Kruse | # |
| 10 | 31c7de62 | Peter Holzleitner | # 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 | 212768ed | dipohl | print "graph_category mail\n"; |
| 27 | 31c7de62 | Peter Holzleitner | 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"; |
