mirror of
https://github.com/munin-monitoring/contrib.git
synced 2018-11-08 00:59:34 +01:00
212768ed9b
bird -> network (bird) chilli -> wireless (chilli) geowebcache -> other (geowebcache) healthcheck -> other (healthcheck) j-chkmail -> mail (j-chkmail) mythtv -> tv scalix -> mail
51 lines
1008 B
Perl
Executable File
51 lines
1008 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 mail\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";
|