From: Florian Forster Date: Sat, 14 Mar 2009 12:31:00 +0000 (+0100) Subject: contrib/collection3: Add the "height" parameter. X-Git-Tag: collectd-4.6.2~2^2~5 X-Git-Url: https://git.octo.it/?p=collectd.git;a=commitdiff_plain;h=4fc99a11cac5ab6d833b63cd04028d4ee09bd318 contrib/collection3: Add the "height" parameter. --- diff --git a/contrib/collection3/bin/graph.cgi b/contrib/collection3/bin/graph.cgi index c246bda6..c096dc94 100755 --- a/contrib/collection3/bin/graph.cgi +++ b/contrib/collection3/bin/graph.cgi @@ -20,6 +20,7 @@ our $Debug = param ('debug'); our $Begin = param ('begin'); our $End = param ('end'); our $GraphWidth = param ('width'); +our $GraphHeight = param ('height'); our $Index = param ('index') || 0; our $OutputFormat = 'PNG'; our $ContentType = 'image/png'; @@ -59,6 +60,16 @@ if (!$GraphWidth) $GraphWidth = gc_get_scalar ('GraphWidth', 400); } +if ($GraphHeight) +{ + $GraphHeight =~ s/\D//g; +} + +if (!$GraphHeight) +{ + $GraphHeight = gc_get_scalar ('GraphHeight', 100); +} + { # Sanitize begin and end times $End ||= 0; $Begin ||= 0; @@ -191,7 +202,7 @@ else } $| = 1; - RRDs::graph ('-', '-a', $OutputFormat, '--width', $GraphWidth, @timesel, @$args); + RRDs::graph ('-', '-a', $OutputFormat, '--width', $GraphWidth, '--height', $GraphHeight, @timesel, @$args); if (my $err = RRDs::error ()) { print STDERR "RRDs::graph failed: $err\n";