Skip to content
This repository was archived by the owner on Jan 8, 2019. It is now read-only.

Commit 25013f4

Browse files
committed
add link to api browser and link to knowledgebase for alert polling
issue #633
1 parent 9e18e6e commit 25013f4

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

app/controllers/AlertsController.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,11 @@
2222
import com.google.inject.Inject;
2323
import lib.APIException;
2424
import lib.ApiClient;
25-
import models.User;
26-
import models.UserService;
25+
import models.*;
2726
import models.alerts.Alert;
2827
import models.alerts.AlertCondition;
2928
import models.alerts.AlertConditionService;
30-
import models.Stream;
31-
import models.StreamService;
3229
import models.api.requests.alerts.CreateAlertConditionRequest;
33-
import play.Logger;
3430
import play.mvc.Result;
3531

3632
import java.io.IOException;
@@ -51,6 +47,9 @@ public class AlertsController extends AuthenticatedController {
5147
@Inject
5248
private AlertConditionService alertConditionService;
5349

50+
@Inject
51+
private NodeService nodeService;
52+
5453
public Result index(String streamId) {
5554
try {
5655
Stream stream = streamService.get(streamId);
@@ -78,7 +77,8 @@ public Result index(String streamId) {
7877
alertConditions,
7978
totalAlerts,
8079
alerts,
81-
users.toString()
80+
users.toString(),
81+
nodeService.loadMasterNode()
8282
));
8383
} catch (IOException e) {
8484
return status(504, views.html.errors.error.render(ApiClient.ERROR_MSG_IO, e, request()));

app/views/alerts/manage.scala.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
alertConditions: List[models.alerts.AlertCondition],
33
totalAlerts: Long,
44
alerts: List[models.alerts.Alert],
5-
users: String)
5+
users: String,
6+
node: Node)
67

78
@import lib.security.RestPermissions._
89
@import views.helpers.Permissions._
@@ -228,8 +229,9 @@ <h2><i class="icon icon-group"></i> Alert receivers</h2>
228229
<hr />
229230

230231
<h2><i class="icon icon-bell"></i> Triggered alerts</h2>
231-
Showing the most recent alerts. This stream triggered a total of @totalAlerts alerts.
232-
232+
Showing the most recent alerts. This stream triggered a total of <b>@totalAlerts alerts</b>.<br>
233+
Alerts can be retrieved from the server's <a href="@node.getTransportAddress/api-browser#!/Alerts/checkConditions_get_1" target="_blank">API Browser <i class="icon icon-external-link" style="font-size: 11px;"></i></a>,
234+
for example to hook them into an existing monitoring system. Learn more in the knowledgebase. @views.html.partials.support.bubble("graylog2-server/polling-for-stream-alerts")
233235
@if(stream.getAlerts.isEmpty) {
234236
<div style="margin-top: 10px;" class="alert alert-info">
235237
This stream has never triggered an alert.

0 commit comments

Comments
 (0)