238.5. Using NagiosEventNotifer
Nagios 组件还提供 EventNotifer,您可以使用它来向 Nagios 发送事件。例如,我们可以从 Java 启用此功能,如下所示:
NagiosEventNotifier notifier = new NagiosEventNotifier();
notifier.getConfiguration().setHost("localhost");
notifier.getConfiguration().setPort(5667);
notifier.getConfiguration().setPassword("password");
CamelContext context = ...
context.getManagementStrategy().addEventNotifier(notifier);
return context;
在 Spring XML 中,只需定义带有类型 EventNotifier 的 Spring bean,Camel 将按照以下所述获取它: 使用 Spring 的 CamelContext 高级配置。