Rcriture du script directement en shell, on viter les timeouts de munin

comme a.

darcs-hash:20060501061722-72cb0-a68f4d7a3ea38adce7bc31328ba1c961db0a7edd.gz
This commit is contained in:
salles 2006-05-01 08:17:22 +02:00
parent 1ae73253fa
commit 384fdff0c4

View file

@ -1,68 +1,29 @@
#!/usr/bin/perl -w #! /bin/sh
#
# Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; version 2 dated June,
# 1991.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# If you improve this script please send your version to my email address
# with the copyright notice upgrade with your name.
#
# Plugin to monitor number of files in apt-proxy cache
#
# $Log: apt-proxy,v $ # $Log: apt-proxy,v $
# Revision 1.1 2006-04-26 21:03:03 salles # Revision 1.2 2006-05-01 06:17:22 salles
# On ajoute un plugin pour apt-proxy # Réécriture du script directement en shell, on éviter les timeouts de munin
# comme ça.
# #
# Revision 1.1 2006/03/28 21:04:01 rodo
# Created by Rodolphe Quiedeville
# #
# Must run on aptproxy user or root # Must run on aptproxy user or root
# #
#%# family=apt-proxy
#%# capabilities=autoconf
use strict;
if ($ARGV[0] and $ARGV[0] eq "config") if [ "$1" = "config" ]; then
{ echo "graph_title Files in apt-proxy cache"
print "graph_title Files in apt-proxy cache\n"; echo "graph_args --base 1000 -l 0"
print "graph_args --base 1000 -l 0\n"; echo "graph_vlabel files"
print "graph_vlabel files\n"; echo "main.label main"
print "main.label main\n"; echo "main.info Packages in main"
print "main.info Packages in main\n"; echo "main.draw AREA"
print "main.draw AREA\n"; echo "security.label security"
print "security.label security\n"; echo "security.info Packages in security"
print "security.info Packages in security\n"; echo "security.draw STACK"
print "security.draw STACK\n"; exit 0;
exit 0; fi
}
my $cache = "/pubftp/apt-proxy/debian/pool/main "; main="/pubftp/apt-proxy/debian/pool/main ";
my $security = "/pubftp/apt-proxy/security/pool/updates/main "; security="/pubftp/apt-proxy/security/pool/updates/main ";
open (HOME,"find $cache -type f | wc -l |"); echo "main.value" `find $main -type f | wc -l`
my $files = <HOME>; echo "security.value" `find $security -type f | wc -l`
close(HOME);
open (HOME,"find $security -type f | wc -l |");
my $files_secu = <HOME>;
close(HOME);
chomp($files);chomp($files_secu);
print "main.value ".$files."\n";
print "security.value ".$files_secu."\n";
# vim:syntax=perl