Using templates.dist/default.php this gives me 3 graphs (as I would expect).
Now this problem I have is, that I wish to make one more graph that has all 3 values in it.
I've been fiddling around with a template file but the results I'm getting seems very random and confusing.
Code: Select all
<?php
for($i=1; $i < count($DS); $i++) {
$opt[$i] = '--title "My graph '.$i.'"';
$def[$i] = 'DEF:var1='.$rrdfile.':'.$DS[$i].':AVERAGE LINE1:var1#000000';
}
$opt[4] = '--title "My graph 4"';
$def[4] =
'DEF:var1='.$rddfile.':'.$DS[1].':AVERAGE '.
'DEF:var2='.$rddfile.':'.$DS[2].':AVERAGE '.
'DEF:var3='.$rddfile.':'.$DS[3].':AVERAGE '.
'LINE1:var1#FF0000:"Var 1" '.
'LINE1:var2#FF0000:"Var 2" '.
'LINE1:var3#FF0000:"Var 3"';
?>
When I add the 4th graph it draws 3 graphs. If I add a $def[5] = "hmmm"; then the 4th graph displays, but with a broken picture icon.
I've changed titles to make sure it really is this file and not something cached, but these change like I would expect them them.
Can anyone please shed some light on what is going on here?
Using only the fourth combined graph as $def[1] works.
Trying to debug why it won't display as the fourth graph has led me to nagiosxi/html/includes/components/perfdata/graphApi.php. It looks like it tries to find a fourth datasource from the perfdata xml file located next to the rrd file. This, ofcause, only has 3 datasets as I'm only working with 3 datasets. I need all four graphs.
How do I add more graphs for a given service than the amount of datasets?