Search in sources :

Example 6 with SnmpEventInfo

use of org.opennms.netmgt.config.SnmpEventInfo in project opennms by OpenNMS.

the class Collectd method handleConfigureSNMP.

/**
     * This method is responsible for handling configureSNMP events.
     * 
     * @param event
     *            The event to process.
     */
private void handleConfigureSNMP(final Event event) {
    LOG.debug("configureSNMPHandler: processing configure SNMP event...", event);
    SnmpEventInfo info = null;
    try {
        info = new SnmpEventInfo(event);
        if (StringUtils.isBlank(info.getFirstIPAddress())) {
            LOG.error("configureSNMPHandler: event contained invalid firstIpAddress. {}", event);
            return;
        }
        LOG.debug("configureSNMPHandler: processing configure SNMP event: {}", info);
        SnmpPeerFactory.getInstance().define(info);
        SnmpPeerFactory.getInstance().saveCurrent();
        LOG.debug("configureSNMPHandler: process complete. {}", info);
    } catch (Throwable e) {
        LOG.error("configureSNMPHandler: ", e);
    }
}
Also used : SnmpEventInfo(org.opennms.netmgt.config.SnmpEventInfo)

Aggregations

SnmpEventInfo (org.opennms.netmgt.config.SnmpEventInfo)6 Consumes (javax.ws.rs.Consumes)2 PUT (javax.ws.rs.PUT)2 Path (javax.ws.rs.Path)2 SnmpInfo (org.opennms.web.svclayer.model.SnmpInfo)2 RequestDispatcher (javax.servlet.RequestDispatcher)1 IPAddress (org.opennms.core.network.IPAddress)1 IPAddressRange (org.opennms.core.network.IPAddressRange)1 EventHandler (org.opennms.netmgt.events.api.annotations.EventHandler)1 Transactional (org.springframework.transaction.annotation.Transactional)1