Skip to content

Commit

Permalink
m/g: add some extra args to rrd-graph
Browse files Browse the repository at this point in the history
This enables a generic way to redefine the color palette.

Note:

  This is very crude so I won't document it publicly. If it is very
  useful, it should have a proper munin.conf configuration.
  • Loading branch information
steveschnepp committed Nov 1, 2023
1 parent 84d1a53 commit 2c2ea00
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/Munin/Master/Graph.pm
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,6 @@ sub expand_cdef {
sub RRDs_graph {
# RRDs::graph() is *STATEFUL*. It doesn't emit the same PNG
# when called the second time.
#
RRDs::graph(@_);
my $rrd_error = RRDs::error();
return $rrd_error;
Expand All @@ -824,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 2c2ea00

Please sign in to comment.