summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 20a7434)
raw | patch | inline | side by side (parent: 20a7434)
author | Sebastian Harl <sh@tokkee.org> | |
Mon, 12 Nov 2007 12:05:54 +0000 (13:05 +0100) | ||
committer | Florian Forster <octo@huhu.verplant.org> | |
Wed, 14 Nov 2007 10:48:27 +0000 (11:48 +0100) |
* Use Perl's undef to identify invalid values.
* Renamed the "host-is" command line option to "host".
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
* Renamed the "host-is" command line option to "host".
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
contrib/collectd2html.pl | patch | blob | history |
index da143d700b3d65f41f51a84106264ebb3845cc2d..32d6305592981b7f27ace786051834f52c42fc72 100644 (file)
--- a/contrib/collectd2html.pl
+++ b/contrib/collectd2html.pl
#
# Copyright 2006 Vincent Stehlé <vincent.stehle@free.fr>
#
+# Patch to configure the data directory and hostname by Eddy Petrisor
+# <eddy.petrisor@gmail.com>.
+#
# 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
use Getopt::Long qw(:config no_ignore_case bundling pass_through);
my $DIR = "/var/lib/collectd";
-my $HOST = "_UNDEFINED_";
+my $HOST = undef;
GetOptions (
- "host-is=s" => \$HOST,
+ "host=s" => \$HOST,
"data-dir=s" => \$DIR
);
my @COLORS = (0xff7777, 0x7777ff, 0x55ff55, 0xffcc77, 0xff77ff, 0x77ffff,
0xffff77, 0x55aaff);
my @tmp = `/bin/hostname`; chomp(@tmp);
-$HOST = $tmp[0] if ( $HOST =~ /_UNDEFINED_/ );
+$HOST = $tmp[0] if (! defined $HOST);
my $IMG_DIR = "${HOST}.dir";
my $HTML = "${HOST}.html";