Skip to content

Commit

Permalink
m/g: use a more generic way to add rrd args
Browse files Browse the repository at this point in the history
  • Loading branch information
steveschnepp committed Nov 1, 2023
1 parent 63acd17 commit 672a029
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/Munin/Master/Graph.pm
Original file line number Diff line number Diff line change
Expand Up @@ -815,8 +815,6 @@ sub expand_cdef {
sub RRDs_graph {
# RRDs::graph() is *STATEFUL*. It doesn't emit the same PNG
# when called the second time.
#
push @_, "--color", $ENV{RRD_COLOR} if $ENV{RRD_COLOR};
RRDs::graph(@_);
my $rrd_error = RRDs::error();
return $rrd_error;
Expand All @@ -825,6 +823,14 @@ sub RRDs_graph {
sub RRDs_graph_or_dump {
use RRDs;

# Appending $RRD_EXTRA_ARGS if present
if ($ENV{RRD_EXTRA_ARGS}) {
# Beware, the split is rather simple, and does not
# handle the following : "this contains spaces"
my @RRD_EXTRA_ARGS = split(/ /, $ENV{RRD_EXTRA_ARGS});
push @_, @RRD_EXTRA_ARGS;
}

my $fileext = shift;
if ($fileext =~ m/PNG|SVG|EPS|PDF/) {
RRDs_graph(@_);
Expand Down

0 comments on commit 672a029

Please sign in to comment.