237.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 高级配置。