public static String GenerateLink(String relativeUrl, ServicePolicy pol) { if (pol.getPolicyType() == null || pol.getPolicyType() == PolicyType.TRANSACTIONAL) { return "<a href=\"" + relativeUrl + "/TransactionLogViewer.jsp?url=" + URLEncoder.encode(pol.getURL()) + "\">View recent transactions</a><br>" + "<a href=\"" + relativeUrl + "/availability.jsp?url=" + URLEncoder.encode(pol.getURL()) + "\">View availability data</a>"; } if (pol.getPolicyType() == PolicyType.STATISTICAL) { return "<a href=\"" + relativeUrl + "/messageBrokerDetail.jsp?url=" + URLEncoder.encode(pol.getURL()) + "\">View statistics</a><br>" + "<a href=\"" + relativeUrl + "/availability.jsp?url=" + URLEncoder.encode(pol.getURL()) + "\">View availability data</a>"; } if (pol.getPolicyType() == PolicyType.STATUS) { return "<a href=\"" + relativeUrl + "/availability.jsp?url=" + URLEncoder.encode(pol.getURL()) + "\">View availability data</a>"; } return "<a href=\"" + relativeUrl + "\">fgsms</a>"; }
@Override public boolean CheckNonTransactionalRule(ServicePolicy pol, List<NameValuePair> params, AtomicReference<String> nullableFaultMsg, boolean pooled) { if (nullableFaultMsg == null) { nullableFaultMsg = new AtomicReference<String>(); } NameValuePair GetNameValuePairByName = Utility.getNameValuePairByName(params, "value"); long rate = Long.parseLong(GetNameValuePairByName.getValue()); GetNameValuePairByName = Utility.getNameValuePairByName(params, "duration"); long duration = Long.parseLong(GetNameValuePairByName.getValue()); long faultrate = NonTransactionalSLAProcessor.GetDiskUsageOverTime(pol.getURL(),duration, pooled); if (faultrate > rate) { nullableFaultMsg.set("The measured Disk I/O rate" + faultrate + " is greater than " + rate + ", " + nullableFaultMsg.get()); return true; } return false; }
@Override public boolean CheckNonTransactionalRule(ServicePolicy pol, List<NameValuePair> params, AtomicReference<String> nullableFaultMsg, boolean pooled) { if (nullableFaultMsg == null) { nullableFaultMsg = new AtomicReference<String>(); } NameValuePair GetNameValuePairByName = Utility.getNameValuePairByName(params, "value"); long rate = Long.parseLong(GetNameValuePairByName.getValue()); GetNameValuePairByName = Utility.getNameValuePairByName(params, "duration"); long duration = Long.parseLong(GetNameValuePairByName.getValue()); // long rate = x.getFaults();//) / (double) (Utility.durationToTimeInMS(x.getTime()))); long faultrate = NonTransactionalSLAProcessor.GrabFaultRate(duration, pol.getURL()); if (faultrate > rate) { nullableFaultMsg.set("Faults Over Time measured value of " + faultrate + " is greater than " + rate + ", " + nullableFaultMsg.get()); return true; } return false; }
@Override public boolean CheckNonTransactionalRule(ServicePolicy pol, List<NameValuePair> params, AtomicReference<String> nullableFaultMsg, boolean pooled) { if (nullableFaultMsg == null) { nullableFaultMsg = new AtomicReference<String>(); } NameValuePair GetNameValuePairByName = Utility.getNameValuePairByName(params, "value"); long rate = Long.parseLong(GetNameValuePairByName.getValue()); GetNameValuePairByName = Utility.getNameValuePairByName(params, "duration"); long duration = Long.parseLong(GetNameValuePairByName.getValue()); // long rate = x.getFaults();//) / (double) (Utility.durationToTimeInMS(x.getTime()))); long faultrate = NonTransactionalSLAProcessor.GrabFaultRate(duration, pol.getURL()); if (faultrate < rate) { nullableFaultMsg.set("Faults Over Time measured value of " + faultrate + " is less than " + rate + ", " + nullableFaultMsg.get()); return true; } return false; }
@Override public boolean CheckNonTransactionalRule(ServicePolicy pol, List<NameValuePair> params, AtomicReference<String> nullableFaultMsg, boolean pooled) { if (nullableFaultMsg == null) { nullableFaultMsg = new AtomicReference<String>(); } NameValuePair GetNameValuePairByName = Utility.getNameValuePairByName(params, "value"); long rate = Long.parseLong(GetNameValuePairByName.getValue()); GetNameValuePairByName = Utility.getNameValuePairByName(params, "duration"); long duration = Long.parseLong(GetNameValuePairByName.getValue()); // long rate = x.getFaults();//) / (double) (Utility.durationToTimeInMS(x.getTime()))); long faultrate = NonTransactionalSLAProcessor.GrabInvocationRate(duration, pol.getURL()); if (faultrate < rate) { nullableFaultMsg.set("Invocations Over Time measured value of " + faultrate + " is greater than " + rate + ", " + nullableFaultMsg.get()); return true; } return false; }
@Override public boolean CheckNonTransactionalRule(ServicePolicy pol, List<NameValuePair> params, AtomicReference<String> nullableFaultMsg, boolean pooled) { if (nullableFaultMsg == null) { nullableFaultMsg = new AtomicReference<String>(); } NameValuePair GetNameValuePairByName = Utility.getNameValuePairByName(params, "value"); long rate = Long.parseLong(GetNameValuePairByName.getValue()); GetNameValuePairByName = Utility.getNameValuePairByName(params, "duration"); long duration = Long.parseLong(GetNameValuePairByName.getValue()); long faultrate = NonTransactionalSLAProcessor.GetMemoryUsageOverTime(pol.getURL(),duration, pooled); if (faultrate > rate) { nullableFaultMsg.set("The measured Memory usage of " + faultrate + " is greater than " + rate + ", " + nullableFaultMsg.get()); return true; } return false; }
@Override public boolean CheckNonTransactionalRule(ServicePolicy pol, List<NameValuePair> params, AtomicReference<String> nullableFaultMsg, boolean pooled) { if (nullableFaultMsg == null) { nullableFaultMsg = new AtomicReference<String>(); } NameValuePair GetNameValuePairByName = Utility.getNameValuePairByName(params, "value"); long rate = Long.parseLong(GetNameValuePairByName.getValue()); GetNameValuePairByName = Utility.getNameValuePairByName(params, "duration"); long duration = Long.parseLong(GetNameValuePairByName.getValue()); long faultrate = NonTransactionalSLAProcessor.GetDiskUsageOverTime(pol.getURL(), duration, pooled); if (faultrate > rate) { nullableFaultMsg.set("The measured Disk I/O rate, " + faultrate + " is greater than " + rate + ", " + nullableFaultMsg.get()); return true; } return false; }
@Override public boolean CheckNonTransactionalRule(ServicePolicy pol, List<NameValuePair> params, AtomicReference<String> nullableFaultMsg, boolean pooled) { if (nullableFaultMsg == null) { nullableFaultMsg = new AtomicReference<String>(); } NameValuePair GetNameValuePairByName = Utility.getNameValuePairByName(params, "value"); long rate = Long.parseLong(GetNameValuePairByName.getValue()); GetNameValuePairByName = Utility.getNameValuePairByName(params, "duration"); long duration = Long.parseLong(GetNameValuePairByName.getValue()); long faultrate = NonTransactionalSLAProcessor.GetCPUUsageOverTime(pol.getURL(),duration, pooled); if (faultrate > rate) { nullableFaultMsg.set("CPU Usage measured value of " + faultrate + " is greater than the threshold of " + rate + ", " + nullableFaultMsg.get()); return true; } return false; }
@Override public boolean CheckNonTransactionalRule(ServicePolicy pol, List<NameValuePair> params, AtomicReference<String> nullableFaultMsg, boolean pooled) { if (nullableFaultMsg == null) { nullableFaultMsg = new AtomicReference<String>(); } NameValuePair GetNameValuePairByName = Utility.getNameValuePairByName(params, "duration"); long duration = Long.parseLong(GetNameValuePairByName.getValue()); NameValuePair rater = Utility.getNameValuePairByName(params, "value"); long rate = Long.parseLong(rater.getValue()); // long rate = x.getFaults();//) / (double) (Utility.durationToTimeInMS(x.getTime()))); long faultrate = NonTransactionalSLAProcessor.GrabMTBF(duration, pol.getURL()); if (faultrate < duration) { nullableFaultMsg.set("MTBF measured value of " + faultrate + " is less than " + rate + ", " + nullableFaultMsg.get()); return true; } return false; }
@Override public boolean CheckNonTransactionalRule(ServicePolicy pol, List<NameValuePair> params, AtomicReference<String> nullableFaultMsg, boolean pooled) { if (nullableFaultMsg == null) { nullableFaultMsg = new AtomicReference<String>(); } NameValuePair GetNameValuePairByName = Utility.getNameValuePairByName(params, "value"); long rate = Long.parseLong(GetNameValuePairByName.getValue()); GetNameValuePairByName = Utility.getNameValuePairByName(params, "duration"); long duration = Long.parseLong(GetNameValuePairByName.getValue()); // long rate = x.getFaults();//) / (double) (Utility.durationToTimeInMS(x.getTime()))); long faultrate = NonTransactionalSLAProcessor.GrabInvocationRate(duration, pol.getURL()); if (faultrate > rate) { nullableFaultMsg.set("Invocations Over Time measured value of " + faultrate + " is greater than " + rate + ", " + nullableFaultMsg.get()); return true; } return false; }
@Override public boolean CheckNonTransactionalRule(ServicePolicy pol, List<NameValuePair> params, AtomicReference<String> nullableFaultMsg, boolean pooled) { if (nullableFaultMsg == null) { nullableFaultMsg = new AtomicReference<String>(); } NameValuePair GetNameValuePairByName = Utility.getNameValuePairByName(params, "duration"); long duration = Long.parseLong(GetNameValuePairByName.getValue()); NameValuePair rater = Utility.getNameValuePairByName(params, "value"); long rate = Long.parseLong(rater.getValue()); // long rate = x.getFaults();//) / (double) (Utility.durationToTimeInMS(x.getTime()))); long faultrate = NonTransactionalSLAProcessor.GrabMTBF(duration, pol.getURL()); if (faultrate > duration) { nullableFaultMsg.set("MTBF measured value of " + faultrate + " is greater than " + rate + ", " + nullableFaultMsg.get()); return true; } return false; }
log.log(Level.WARN, "SLA Fault tripped for " + servicePolicyQueue.get(k).getURL() + " message: " + faultMsg); SLACommon.RecordSLAFault(new AtomicReference<String>(faultMsg.toString()), servicePolicyQueue.get(k).getURL(), null, System.currentTimeMillis(), incident, ispooled); SLACommon.ProcessAlerts(faultMsg.toString(), "<h2>" + Utility.encodeHTML(faultMsg.toString()) + "</h2>", servicePolicyQueue.get(k).getURL(), null, System.currentTimeMillis(), incident, ispooled, false, servicePolicyQueue.get(k).getServiceLevelAggrements().getSLA().get(i).getAction().getSLAAction(), servicePolicyQueue.get(k).getServiceLevelAggrements().getSLA().get(i).getGuid(), servicePolicyQueue.get(k), AlertType.Performance);
long laststatusat = NonTransactionalSLAProcessor.GetLastKnownStatus(pol.getURL(), pooled, status); if (System.currentTimeMillis() - laststatusat > threshold) {
log.log(Level.INFO, "SLA violation for the service at " + pol.getURL() + " Transaction ID: " + transactionid + " " + ref.get()); SLACommon.RecordSLAFault(ref, pol.getURL(), transactionid, time, incident, true); SLACommon.ProcessAlerts(ref.get(), ref.get() + "<br>" + GenerateLink(props.getProperty("fgsms.GUI.URL"), pol.getURL(), transactionid), pol.getURL(), transactionid, time, incident, true, false, pol.getServiceLevelAggrements().getSLA().get(i).getAction().getSLAAction(), pol.getServiceLevelAggrements().getSLA().get(i).getGuid(), pol, AlertType.Performance);
s.setAction(new ArrayOfSLAActionBaseType()); SLAAction e = Utility.newEmailAction(null, "Change of status for " + Utility.encodeHTML(ret.getURL()), "Change of status for " + Utility.encodeHTML(ret.getURL()) + ". This is the default status alert. This can be changed by changing the policy for this service."); s.getAction().getSLAAction().add(e); ret.getServiceLevelAggrements().getSLA().add(s); s.setGuid(UUID.randomUUID().toString()); s.setAction(new ArrayOfSLAActionBaseType()); SLAAction e = Utility.newEmailAction(null, "Stale Data Alert for " + Utility.encodeHTML(ret.getURL()), "Stale Data Alert for " + Utility.encodeHTML(ret.getURL()) + ". This is the default alert that indicates that either a server or agent is offline. This alert can be changed by changing the policy for this service.");
log.log(Level.INFO, "Starting UDDI publication for " + sp.getURL()); this.isPooled = pooled; if (!checkTmodelPublication()) { log.log(Level.WARN, "unable to publish UDDI data for service " + sp.getURL() + " because the binding key is null or empty"); return; irr = inquiry.getBindingDetail(ir); } catch (DispositionReportFaultMessage ex) { log.log(Level.ERROR, "Could not publish data for service " + sp.getURL() + " to UDDI binding key " + policy.getBindingKey() + dispositionReportFaultMessageToString(ex), ex); return; } catch (Exception ex) { log.log(Level.ERROR, "Could not publish data for service " + sp.getURL() + " to UDDI binding key " + policy.getBindingKey(), ex); return; log.log(Level.ERROR, "Could not publish data for service " + sp.getURL() + " to UDDI binding key " + policy.getBindingKey() + ". The UDDI server didn't return any binding templates matching the provided key"); return; log.log(Level.WARN, "The UDDI returned more than one binding template for the service " + sp.getURL() + " to UDDI binding key " + policy.getBindingKey() + ". Only the first binding will be modified"); return; log.log(Level.ERROR, "No quick stat data is available for " + sp.getURL() + ", unable to publish"); return; log.log(Level.WARN, "No quick stat data for the time period " + time + " for the service " + sp.getURL() + " is available, skipping."); continue; String val = (GetMonitoredStatusFromDB(sp.getURL(), isPooled)); if (Utility.stringIsNullOrEmpty(val)) {
n.setValue(servicePolicy.getPolicy().getDisplayName()); } else { n.setValue(servicePolicy.getPolicy().getURL()); ap.setValue(servicePolicy.getPolicy().getURL()); req.setClassification(servicePolicy.getClassification()); req.setPolicy(servicePolicy.getPolicy()); req.setURL(servicePolicy.getPolicy().getURL());