コード例 #1
0
 /** {@inheritDoc} */
 @Override
 public void foundMonitoredService(String serviceName) {
   OnmsServiceType svcType = getServiceType(serviceName);
   OnmsMonitoredService service = new OnmsMonitoredService(m_currentInterface, svcType);
   service.setStatus("A");
   m_currentInterface.getMonitoredServices().add(service);
 }
コード例 #2
0
 @Override
 public void updateServiceStatus(int nodeId, String ipAddr, String serviceName, String status) {
   try {
     OnmsMonitoredService service =
         m_monitoredServiceDao.get(nodeId, InetAddress.getByName(ipAddr), serviceName);
     service.setStatus(status);
     m_monitoredServiceDao.saveOrUpdate(service);
   } catch (UnknownHostException e) {
     LOG.error(
         "Failed to set the status for service named {} on node id {} and interface {} to {}.",
         serviceName,
         nodeId,
         ipAddr,
         status,
         e);
   }
 }