Hi,
I got a similar issues when I create thresholds. Sometimes the link looks as already described by blugger:
Sometimes o.K. like:
https://x.x.x.x/graph.php?local_graph_id=3180&rra_id=all
Sometimes local_graph_id=0 like:
https://x.x.x.x/graph.php?local_graph_id=0&rra_id=all
I found a solution which is working to me. I will not say that this is the best solution and maybe it will not cover all of these issues but it's o.K. to me at the moment. By the way: Emails, which are sent out by thold, having the related graph included after this fix. So I am happy at the moment
Pease take care and save your config before you will perform any changes.
What I did:
1.) login as root
2.) backup thold-functions.php: # cp /var/www/html/plugins/thold/thold-functions.php /var/www/html/plugins/thold/thold-functions.php.original
3.) Open /var/www/html/plugins/thold/thold-functions.php with an editor
4.) locate line 2551
(It's the line next of /* Get the Data Template, Graph Template, and Graph */ )
5.) Comment out line 2551
//$rrdsql = db_fetch_row('SELECT id, data_template_id FROM data_template_rrd WHERE local_data_id=' . $save['rra_id'] . ' ORDER BY id');
6.) insert these 3 new lines before line 2551:
$template_rrd = db_fetch_row("select * from data_template_rrd where id=" . $_POST['data_template_rrd_id']);
$mystring = trim($template_rrd['data_source_name']);
$rrdsql = db_fetch_row('SELECT id, data_template_id FROM data_template_rrd WHERE local_data_id=' . $save['rra_id'] . ' and trim(data_source_name)="' . $mystring . '" ORDER BY id');
7.) Check your work:
Line 2550: /* Get the Data Template, Graph Template, and Graph */
Line 2551: $template_rrd = db_fetch_row("select * from data_template_rrd where id=" . $_POST['data_template_rrd_id']);
Line 2552: $mystring = trim($template_rrd['data_source_name']);
Line 2553: $rrdsql = db_fetch_row('SELECT id, data_template_id FROM data_template_rrd WHERE local_data_id=' . $save['rra_id'] . ' and trim(data_source_name)="' . $mystring . '" ORDER BY id');
Line 2554: //$rrdsql = db_fetch_row('SELECT id, data_template_id FROM data_template_rrd WHERE local_data_id=' . $save['rra_id'] . ' ORDER BY id');
8.) save your changes
9.) browser: Go to "Config"-Tab, create a new threshold or open an existing threshold and press "save"
10.)browser: Go to "Threshold"-Tab, click on the graph-Icon and check if the graph will appear
The good thing: I do not have to create the threshold again. Just open the threshold an "save" is enough to update the missing data needed to show the correct link.
One thing which is not clear to me at the moment: I have some thresholds defined for hosts which are not in service at the moment. For these hosts my solution will not work. I have to check it again after the hosts are back in service again.
Maybe my reply can help someone else.
Sorry for my bad english
