Commit 384fdff0 authored by salles's avatar salles

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

comme a.

parent 1ae73253
#!/usr/bin/perl -w
# Copyright (C) 2006 Rodolphe Quiedeville <>
# 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
# 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
#! /bin/sh
# $Log: apt-proxy,v $
# Revision 1.1 2006-04-26 21:03:03 salles
# On ajoute un plugin pour apt-proxy
# Revision 1.2 2006-05-01 06:17:22 salles
# Rcriture 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
#%# family=apt-proxy
#%# capabilities=autoconf
use strict;
if ($ARGV[0] and $ARGV[0] eq "config")
print "graph_title Files in apt-proxy cache\n";
print "graph_args --base 1000 -l 0\n";
print "graph_vlabel files\n";
print "main.label main\n";
print " Packages in main\n";
print "main.draw AREA\n";
print "security.label security\n";
print " Packages in security\n";
print "security.draw STACK\n";
exit 0;
my $cache = "/pubftp/apt-proxy/debian/pool/main ";
my $security = "/pubftp/apt-proxy/security/pool/updates/main ";
open (HOME,"find $cache -type f | wc -l |");
my $files = <HOME>;
open (HOME,"find $security -type f | wc -l |");
my $files_secu = <HOME>;
if [ "$1" = "config" ]; then
echo "graph_title Files in apt-proxy cache"
echo "graph_args --base 1000 -l 0"
echo "graph_vlabel files"
echo "main.label main"
echo " Packages in main"
echo "main.draw AREA"
echo "security.label security"
echo " Packages in security"
echo "security.draw STACK"
exit 0;
print "main.value ".$files."\n";
print "security.value ".$files_secu."\n";
main="/pubftp/apt-proxy/debian/pool/main ";
security="/pubftp/apt-proxy/security/pool/updates/main ";
# vim:syntax=perl
echo "main.value" `find $main -type f | wc -l`
echo "security.value" `find $security -type f | wc -l`
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment