mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Include hostname in alerts_list API command
- Include hostname in alerts_list API command - Update API docs
This commit is contained in:
@ -536,7 +536,7 @@ function list_alerts() {
|
||||
$sql = "AND id=?";
|
||||
array_push($param,$alert_id);
|
||||
}
|
||||
$alerts = dbFetchRows("SELECT * FROM `alerts` WHERE `state` IN (?) $sql",$param);
|
||||
$alerts = dbFetchRows("SELECT `D`.`hostname`, `A`.* FROM `alerts` AS `A`, `devices` AS `D` WHERE `D`.`device_id` = `A`.`device_id` AND `A`.`state` IN (?) $sql",$param);
|
||||
$total_alerts = count($alerts);
|
||||
$output = array("status" => "ok", "err-msg" => '', "count" => $total_alerts, "alerts" => $alerts);
|
||||
$app->response->setStatus('200');
|
||||
|
Reference in New Issue
Block a user