X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=contrib%2Fcollectd2html.pl;h=32d6305592981b7f27ace786051834f52c42fc72;hb=25ac639c505394e4ae9600ee62f5d5aeea97c6d4;hp=6ff1c479e5d13c589fdf2b848b9e8a5533bd7703;hpb=08721598fcbfafa5c63f3977678c5f246daf7b84;p=collectd.git diff --git a/contrib/collectd2html.pl b/contrib/collectd2html.pl index 6ff1c479..32d63055 100644 --- a/contrib/collectd2html.pl +++ b/contrib/collectd2html.pl @@ -16,6 +16,9 @@ # # Copyright 2006 Vincent Stehlé # +# Patch to configure the data directory and hostname by Eddy Petrisor +# . +# # 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; either version 2 of the License, or @@ -36,12 +39,20 @@ use warnings; use strict; use Fatal qw(open close); use File::Basename; +use Getopt::Long qw(:config no_ignore_case bundling pass_through); + +my $DIR = "/var/lib/collectd"; +my $HOST = undef; + +GetOptions ( + "host=s" => \$HOST, + "data-dir=s" => \$DIR +); -my $DIR = "/var/lib/collectd"; my @COLORS = (0xff7777, 0x7777ff, 0x55ff55, 0xffcc77, 0xff77ff, 0x77ffff, 0xffff77, 0x55aaff); my @tmp = `/bin/hostname`; chomp(@tmp); -my $HOST = $tmp[0]; +$HOST = $tmp[0] if (! defined $HOST); my $IMG_DIR = "${HOST}.dir"; my $HTML = "${HOST}.html";