mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 22:25:23 +00:00
Initial version
This commit is contained in:
parent
13e5226dd4
commit
31c7de62c7
1 changed files with 50 additions and 0 deletions
50
plugins/other/scalix_indexwork
Executable file
50
plugins/other/scalix_indexwork
Executable file
|
@ -0,0 +1,50 @@
|
|||
#!/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";
|
Loading…
Add table
Add a link
Reference in a new issue