From: Yuri D'Elia Date: Fri, 18 Dec 2009 11:33:31 +0000 (+0100) Subject: collectd2html: Fixed recursive mode. X-Git-Tag: collectd-4.9.3~12^2~2 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=4de127039456bcd34de35fc83d53501466d2a648;p=collectd.git collectd2html: Fixed recursive mode. Also, improved default settings to match the collectd4 series. Signed-off-by: Sebastian Harl --- diff --git a/contrib/collectd2html.pl b/contrib/collectd2html.pl index 7953d67c..210fd646 100644 --- a/contrib/collectd2html.pl +++ b/contrib/collectd2html.pl @@ -44,7 +44,7 @@ use Getopt::Long qw(:config no_ignore_case bundling pass_through); my $DIR = "/var/lib/collectd"; my $HOST = undef; my $IMG_FMT = "PNG"; -my $RECURSIVE = 0; +my $RECURSIVE = 1; GetOptions ( "host=s" => \$HOST, @@ -63,7 +63,7 @@ if (defined($HOST) && ($DIR !~ m/\/$HOST\/?$/) && (-d "$DIR/$HOST")) { my @COLORS = (0xff7777, 0x7777ff, 0x55ff55, 0xffcc77, 0xff77ff, 0x77ffff, 0xffff77, 0x55aaff); -my @tmp = `/bin/hostname`; chomp(@tmp); +my @tmp = `/bin/hostname -f`; chomp(@tmp); $HOST = $tmp[0] if (! defined $HOST); my $svg_p = ($IMG_FMT eq "SVG"); my $IMG_SFX = $svg_p ? ".svg" : ".png"; @@ -140,7 +140,8 @@ else { } chomp(@list); -foreach my $rrd (sort @list){ +@list = sort @list; +foreach my $rrd (@list){ $rrd =~ m/^$DIR\/(.*)\.rrd$/; push(@rrds, $1); }