Ejemplo n.º 1
0
 @Override
 public boolean exist(String hostname, HttpServletRequest request) {
   try {
     hosttarget = makeSnmpTarget(request);
     active = new LocalSnmpConnection();
     active.target = hosttarget;
     active.doStart();
     if (SnmpRequester.RAW.doSnmpGet(active, Collections.singleton(sysObjectID)).size() < 0) {
       log(Level.INFO, "SNMP not active on host %s", hostname);
       return false;
     }
     return true;
   } catch (UnknownHostException e) {
     log(Level.INFO, "Host name %s unknown", hostname);
     return false;
   } catch (IOException e1) {
     log(Level.INFO, "SNMP not active on host %s", hostname);
     return false;
   }
 }