mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Added flag to get_graph_by_port_hostname() API call to switch port look up to use ifDescr
This commit is contained in:
@ -62,10 +62,17 @@ function get_graph_by_port_hostname() {
|
||||
$vars['to'] = $_GET['to'];
|
||||
}
|
||||
|
||||
if (!empty($vars['ifDescr']) == true) {
|
||||
$port = 'ifDescr';
|
||||
}
|
||||
else {
|
||||
$port = 'ifName';
|
||||
}
|
||||
|
||||
$vars['width'] = $_GET['width'] ?: 1075;
|
||||
$vars['height'] = $_GET['height'] ?: 300;
|
||||
$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`.`ifName`=?', array($hostname, $vars['port']));
|
||||
$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');
|
||||
include 'includes/graphs/graph.inc.php';
|
||||
|
||||
|
Reference in New Issue
Block a user