2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00
contrib-munin/plugins/other/scalix_indexwork
Peter Holzleitner 31c7de62c7 Initial version
2011-12-18 15:10:16 +01:00

51 lines
1010 B
Perl
Executable File

#!/usr/bin/perl
#
# Plugin to monitor the Scalix email system.
#
# $Log$
#
#
# Parameters:
#
# config (required)
# autoconf (optional - used by munin-config)
#
# Magic markers (Used by munin-config and some installation scripts.
# Optional):
#
#%# family=contrib
my $OMRP="/opt/scalix/bin/omrealpath";
my $mode = shift;
if($mode eq "config") {
print "graph_title Scalix Index Work Queue\n";
print "graph_args -l 0\n";
print "graph_vlabel number\n";
print "graph_category Scalix\n";
print "graph_title Scalix Index Work Queue\n";
print "graph_vlabel Items\n";
print "items.label Items to be indexed\n";
print "items.min 0\n";
exit 0;
}
my $iwdir = `$OMRP "~/indexwork"`; chomp $iwdir;
#print "$iwdir\n";
my ($f, $fsize, $i);
opendir(DIR, $iwdir);
while ($f = readdir(DIR)) {
next unless $f =~ /\d+\.\d/;
$fsize = -s $iwdir . '/' . $f;
# print "$f $fsize\n";
$i += ($fsize / 112);
}
closedir(DIR);
$i = int $i;
print "items.value $i\n";