Closed RutgerLubbers closed 5 years ago
Huh, that's not great. I think the solution should be: a property on this class to store the 'effective' value of rrd_use_poller_output determined by init(), so that the readData() method can use it, without changing the original hint at all.
The context not being 'cacti' is the right way around... once we get to contexts of 'librenms' etc also, it's something that doesn't need to be adjusted all the time.
All right, I think I can set this property in the RRDTool class. Would you like to discuss this here first, or should I create a PR and continue there?
Go for it! It should be a pretty simple change.
Given a configuration that has
rrd_use_poller_output
set to1
, this property is set tofalse
(0
) after an edit. (For instance094-test.conf
has this hint / property set.)The git commit
846b5f6973a507e27a520a67e6dc02104a23053b
introduced some logic to fallback to the traditional rrdtool instead of using poller output.In RRDTool.php, line 51, a the map's context is checked to differ from the value
cacti
. Since the editor has the contexteditor
the value forrrd_use_poller_output
is set tofalse
after each edit.A bit further in the file (line 66) a map's context is checked against
cli
. So, would it be better to check the map's context to be equal tocli
instead of not being equal tocacti
?I could create a PR for this, however I don't know how to check whether this does not reintroduce the issue that was solved by the git commit
846b5f6973a507e27a520a67e6dc02104a23053b
.