Ejemplo n.º 1
0
 private AlarmsEvent createEvent(
     Device device, Date triggeTime, Threshold threshold, String sourceType, String sourceKey) {
   AlarmsEvent ae = new AlarmsEvent();
   ae.setAlertCount(1);
   ae.setAlertName(threshold.getAlertName());
   ae.setAlertTime(new Date());
   ae.setAlertTypeId(threshold.getId());
   ae.setTrapTypeOid(threshold.getSourceId());
   ae.setDeviceName(device.getName());
   ae.setIpAddress(device.getIp());
   ae.setNodeId(device.getId());
   ae.setSeverity(threshold.getSeverity());
   ae.setSourceType(sourceType);
   ae.setSourceKey(sourceKey);
   return ae;
 }
Ejemplo n.º 2
0
 private AlarmsCurrent createAlarm(
     Device device, Date triggeTime, Threshold threshold, String sourceType, String sourceKey) {
   AlarmsCurrent ac = new AlarmsCurrent();
   ac.setAlertCount(1);
   ac.setAlertName(threshold.getAlertName());
   ac.setAlertTime(new Date());
   ac.setAlertTypeId(threshold.getId());
   ac.setTrapTypeOid(threshold.getSourceId());
   ac.setDeviceName(device.getName());
   ac.setIpAddress(device.getIp());
   ac.setNodeId(device.getId());
   ac.setSeverity(threshold.getSeverity());
   ac.setSourceType(sourceType);
   ac.setSourceKey(sourceKey);
   ac.setAcknowledge(0);
   ac.setTriggeTime(triggeTime);
   return ac;
 }