From 2c2ea008dc2d4f54251d8cdaf6c984cb432c7172 Mon Sep 17 00:00:00 2001 From: Steve Schnepp Date: Thu, 12 Oct 2023 21:01:40 +0200 Subject: [PATCH] m/g: add some extra args to rrd-graph 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. --- lib/Munin/Master/Graph.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/Munin/Master/Graph.pm b/lib/Munin/Master/Graph.pm index 73e9b6f35..66a107a89 100644 --- a/lib/Munin/Master/Graph.pm +++ b/lib/Munin/Master/Graph.pm @@ -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; @@ -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(@_);