api: Fixed zombie processes when generating graphs (#5597)

This commit is contained in:
Neil Lathwood
2017-01-25 19:16:59 +00:00
committed by Tony Murray
parent 6e2513eda9
commit 9bcb825560

View File

@@ -73,7 +73,9 @@ function get_graph_by_port_hostname()
$auth = '1';
$vars['id'] = dbFetchCell("SELECT `P`.`port_id` FROM `ports` AS `P` JOIN `devices` AS `D` ON `P`.`device_id` = `D`.`device_id` WHERE `D`.`hostname`=? AND `P`.`$port`=?", array($hostname, $vars['port']));
$app->response->headers->set('Content-Type', 'image/png');
rrdtool_initialize(false);
include 'includes/graphs/graph.inc.php';
rrdtool_close();
}
@@ -148,7 +150,9 @@ function get_graph_generic_by_hostname()
$auth = '1';
$vars['device'] = dbFetchCell('SELECT `D`.`device_id` FROM `devices` AS `D` WHERE `D`.`hostname`=?', array($hostname));
$app->response->headers->set('Content-Type', 'image/png');
rrdtool_initialize(false);
include 'includes/graphs/graph.inc.php';
rrdtool_close();
}
@@ -502,7 +506,9 @@ function get_graph_by_portgroup()
$vars['type'] = 'multiport_bits_separate';
$vars['id'] = $if_list;
$app->response->headers->set('Content-Type', 'image/png');
rrdtool_initialize(false);
include 'includes/graphs/graph.inc.php';
rrdtool_close();
}