use of org.opennms.netmgt.config.ackd.Parameter in project opennms by OpenNMS.
the class MailAckProcessor method determineMailReaderConfig.
/**
* <p>determineMailReaderConfig</p>
*
* @return a {@link org.opennms.netmgt.config.javamail.ReadmailConfig} object.
*/
public ReadmailConfig determineMailReaderConfig() {
LOG.info("determineMailReaderConfig: determining mail reader configuration...");
List<Parameter> parms = m_ackdDao.getParametersForReader("JavaMailReader");
ReadmailConfig config = m_jmConfigDao.getDefaultReadmailConfig();
for (Parameter parameter : parms) {
if ("readmail-config".equalsIgnoreCase(parameter.getKey())) {
config = m_jmConfigDao.getReadMailConfig(parameter.getValue());
}
}
LOG.info("determinedMailReaderConfig: {}", config);
return config;
}
use of org.opennms.netmgt.config.ackd.Parameter in project opennms by OpenNMS.
the class HypericAckProcessorIT method createAckdConfigDao.
private AckdConfigurationDao createAckdConfigDao() {
class AckdConfigDao extends DefaultAckdConfigurationDao {
@Override
public AckdConfiguration getConfig() {
AckdConfiguration config = new AckdConfiguration();
config.setAckExpression("~(?i)^AcK$");
config.setAlarmidMatchExpression("~(?i).*alarmid:([0-9]+).*");
config.setAlarmSync(true);
config.setClearExpression("~(?i)^(Resolve|cleaR)$");
config.setEscalateExpression("~(?i)^esc$");
config.setNotifyidMatchExpression("~(?i).*RE:.*Notice #([0-9]+).*");
config.setUnackExpression("~(?i)^unAck$");
final List<Reader> readers = new ArrayList<>();
{
Reader reader = new Reader();
reader.setEnabled(false);
reader.setReaderName("JavaMailReader");
Parameter hypericHosts = new Parameter();
hypericHosts.setKey("readmail-config");
hypericHosts.setValue("localhost");
reader.addParameter(hypericHosts);
org.opennms.netmgt.config.ackd.ReaderSchedule hypericSchedule = new org.opennms.netmgt.config.ackd.ReaderSchedule();
hypericSchedule.setInterval(60);
hypericSchedule.setUnit("s");
readers.add(reader);
}
{
Reader reader = new Reader();
reader.setEnabled(true);
reader.setReaderName(HypericAckProcessor.READER_NAME_HYPERIC);
Parameter hypericHosts = new Parameter();
hypericHosts.setKey(HypericAckProcessor.PARAMETER_PREFIX_HYPERIC_SOURCE + "HQ-Datacenter");
hypericHosts.setValue("http://hqadmin:hqadmin@127.0.0.1:7081/hqu/opennms/alertStatus/list.hqu");
reader.addParameter(hypericHosts);
hypericHosts = new Parameter();
hypericHosts.setKey(HypericAckProcessor.PARAMETER_PREFIX_HYPERIC_SOURCE + "HQ-Corporate-IT");
hypericHosts.setValue("http://hqadmin:hqadmin@127.0.0.1:7081/hqu/opennms/alertStatus/list.hqu");
reader.addParameter(hypericHosts);
org.opennms.netmgt.config.ackd.ReaderSchedule hypericSchedule = new org.opennms.netmgt.config.ackd.ReaderSchedule();
hypericSchedule.setInterval(3);
hypericSchedule.setUnit("s");
reader.setReaderSchedule(hypericSchedule);
readers.add(reader);
}
config.setReaders(readers);
return config;
}
}
return new AckdConfigDao();
}
Aggregations