Examples of lbmonitor


Examples of com.citrix.netscaler.nitro.resource.config.lb.lbmonitor

    private void addLBMonitor(String nsMonitorName, String lbProtocol, HealthCheckPolicyTO hcp)
            throws ExecutionException {
        try {
            // check if the monitor exists
            boolean csMonitorExisis = false;
            lbmonitor csMonitor = getMonitorIfExisits(nsMonitorName);
            if (csMonitor != null) {
                if (!csMonitor.get_type().equalsIgnoreCase(lbProtocol)) {
                    throw new ExecutionException("Can not update monitor :" + nsMonitorName + " as current protocol:"
                            + csMonitor.get_type() + " of monitor is different from the " + " intended protocol:"
                            + lbProtocol);
                }
                csMonitorExisis = true;
            }
            if (!csMonitorExisis) {
                lbmonitor csMon = new lbmonitor();
                csMon.set_monitorname(nsMonitorName);
                csMon.set_type(lbProtocol);
                if (lbProtocol.equalsIgnoreCase("HTTP")) {
                    csMon.set_httprequest(hcp.getpingPath());
                    s_logger.trace("LB Protocol is HTTP,  Applying  ping path on HealthCheck Policy");
                } else {
                    s_logger.debug("LB Protocol is not HTTP, Skipping to apply  ping path on HealthCheck Policy");
                }

                csMon.set_interval(hcp.getHealthcheckInterval());
                csMon.set_retries(Math.max(hcp.getHealthcheckThresshold(), hcp.getUnhealthThresshold()) + 1);
                csMon.set_resptimeout(hcp.getResponseTime());
                csMon.set_failureretries(hcp.getUnhealthThresshold());
                csMon.set_successretries(hcp.getHealthcheckThresshold());
                s_logger.debug("Monitor properites going to get created :interval :: " + csMon.get_interval() + "respTimeOUt:: " + csMon.get_resptimeout()
                        +"failure retires(unhealththresshold) :: " + csMon.get_failureretries() + "successtries(healththresshold) ::" + csMon.get_successretries());
                lbmonitor.add(_netscalerService, csMon);
            } else {
                s_logger.debug("Monitor :" + nsMonitorName + " is already existing. Skipping to delete and create it");
            }
        } catch (nitro_exception e) {
View Full Code Here

Examples of com.citrix.netscaler.nitro.resource.config.lb.lbmonitor

    private void removeLBMonitor(String nsMonitorName) throws ExecutionException {

        try {
            if (nsMonitorExist(nsMonitorName)) {
                lbmonitor monitorObj = lbmonitor.get(_netscalerService, nsMonitorName);
                monitorObj.set_respcode(null);
                lbmonitor.delete(_netscalerService, monitorObj);
                s_logger.info("Successfully deleted monitor : " + nsMonitorName);
            }
        } catch (nitro_exception e) {
            if (e.getErrorCode() == NitroError.NS_RESOURCE_NOT_EXISTS) {
View Full Code Here

Examples of com.citrix.netscaler.nitro.resource.config.lb.lbmonitor

                            }

                            // Create Monitor
                            // add lb monitor lb_metric_table_mon LOAD -destPort 161 -snmpCommunity public -metricTable
                            // lb_metric_table -interval <policy_interval == 80% >
                            lbmonitor monitor = new lbmonitor();
                            try {
                                monitor.set_monitorname(monitorName);
                                monitor.set_type("LOAD");
                                monitor.set_destport(snmpPort);
                                monitor.set_snmpcommunity(snmpCommunity);
                                monitor.set_metrictable(mtName);
                                monitor.set_interval((int)(interval * 0.8));
                                monitor.add(_netscalerService, monitor);
                            } catch (Exception e) {
                                // Ignore Exception on cleanup
                                if (!isCleanUp)
                                    throw e;
                            }
View Full Code Here

Examples of com.citrix.netscaler.nitro.resource.config.lb.lbmonitor

        }

        private static void createGslbServiceMonitor(nitro_service nsService, String servicePublicIp,
                                                     String serviceName) throws ExecutionException {
            try {
                lbmonitor newmonitor = new lbmonitor();
                String monitorName =  generateGslbServiceMonitorName(servicePublicIp);
                newmonitor.set_type("TCP");
                newmonitor.set_servicename(serviceName);
                newmonitor.set_monitorname(monitorName);
                newmonitor.set_state("ENABLED");
                lbmonitor.add(nsService, newmonitor);
            } catch (nitro_exception ne) {
                if (ne.getErrorCode() == NitroError.NS_RESOURCE_EXISTS) {
                    return;
                }
View Full Code Here

Examples of com.citrix.netscaler.nitro.resource.config.lb.lbmonitor

        }

        private static void deleteGslbServiceMonitor(nitro_service nsService, String monitorName)
                throws ExecutionException {
            try {
                lbmonitor serviceMonitor = lbmonitor.get(nsService, monitorName);
                if (serviceMonitor != null) {
                    lbmonitor.delete(nsService, serviceMonitor);
                }
            } catch (nitro_exception ne) {
                if (ne.getErrorCode() != NitroError.NS_RESOURCE_NOT_EXISTS) {
View Full Code Here

Examples of com.citrix.netscaler.nitro.resource.config.lb.lbmonitor

    private void addLBMonitor(String nsMonitorName, String lbProtocol, HealthCheckPolicyTO hcp)
            throws ExecutionException {
        try {
            // check if the monitor exists
            boolean csMonitorExisis = false;
            lbmonitor csMonitor = getMonitorIfExisits(nsMonitorName);
            if (csMonitor != null) {
                if (!csMonitor.get_type().equalsIgnoreCase(lbProtocol)) {
                    throw new ExecutionException("Can not update monitor :" + nsMonitorName + " as current protocol:"
                            + csMonitor.get_type() + " of monitor is different from the " + " intended protocol:"
                            + lbProtocol);
                }
                csMonitorExisis = true;
            }
            if (!csMonitorExisis) {
                lbmonitor csMon = new lbmonitor();
                csMon.set_monitorname(nsMonitorName);
                csMon.set_type(lbProtocol);
                if (lbProtocol.equalsIgnoreCase("HTTP")) {
                    csMon.set_httprequest(hcp.getpingPath());
                    s_logger.trace("LB Protocol is HTTP,  Applying  ping path on HealthCheck Policy");
                } else {
                    s_logger.debug("LB Protocol is not HTTP, Skipping to apply  ping path on HealthCheck Policy");
                }

                csMon.set_interval(hcp.getHealthcheckInterval());
                csMon.set_retries(Math.max(hcp.getHealthcheckThresshold(), hcp.getUnhealthThresshold()) + 1);
                csMon.set_resptimeout(hcp.getResponseTime());
                csMon.set_failureretries(hcp.getUnhealthThresshold());
                csMon.set_successretries(hcp.getHealthcheckThresshold());
                s_logger.debug("Monitor properites going to get created :interval :: " + csMon.get_interval() + "respTimeOUt:: " + csMon.get_resptimeout()
                        +"failure retires(unhealththresshold) :: " + csMon.get_failureretries() + "successtries(healththresshold) ::" + csMon.get_successretries());
                lbmonitor.add(_netscalerService, csMon);
            } else {
                s_logger.debug("Monitor :" + nsMonitorName + " is already existing. Skipping to delete and create it");
            }
        } catch (nitro_exception e) {
View Full Code Here

Examples of com.citrix.netscaler.nitro.resource.config.lb.lbmonitor

    private void removeLBMonitor(String nsMonitorName) throws ExecutionException {

        try {
            if (nsMonitorExist(nsMonitorName)) {
                lbmonitor monitorObj = lbmonitor.get(_netscalerService, nsMonitorName);
                monitorObj.set_respcode(null);
                lbmonitor.delete(_netscalerService, monitorObj);
                s_logger.info("Successfully deleted monitor : " + nsMonitorName);
            }
        } catch (nitro_exception e) {
            if (e.getErrorCode() == NitroError.NS_RESOURCE_NOT_EXISTS) {
View Full Code Here

Examples of com.citrix.netscaler.nitro.resource.config.lb.lbmonitor

                            }

                            // Create Monitor
                            // add lb monitor lb_metric_table_mon LOAD -destPort 161 -snmpCommunity public -metricTable
                            // lb_metric_table -interval <policy_interval == 80% >
                            lbmonitor monitor = new lbmonitor();
                            try {
                                monitor.set_monitorname(monitorName);
                                monitor.set_type("LOAD");
                                monitor.set_destport(snmpPort);
                                monitor.set_snmpcommunity(snmpCommunity);
                                monitor.set_metrictable(mtName);
                                monitor.set_interval((int)(interval * 0.8));
                                monitor.add(_netscalerService, monitor);
                            } catch (Exception e) {
                                // Ignore Exception on cleanup
                                if (!isCleanUp)
                                    throw e;
                            }
View Full Code Here

Examples of com.citrix.netscaler.nitro.resource.config.lb.lbmonitor

        }

        private static void createGslbServiceMonitor(nitro_service nsService, String servicePublicIp,
                                                     String serviceName) throws ExecutionException {
            try {
                lbmonitor newmonitor = new lbmonitor();
                String monitorName =  generateGslbServiceMonitorName(servicePublicIp);
                newmonitor.set_type("TCP");
                newmonitor.set_servicename(serviceName);
                newmonitor.set_monitorname(monitorName);
                newmonitor.set_state("ENABLED");
                lbmonitor.add(nsService, newmonitor);
            } catch (nitro_exception ne) {
                if (ne.getErrorCode() == NitroError.NS_RESOURCE_EXISTS) {
                    return;
                }
View Full Code Here

Examples of com.citrix.netscaler.nitro.resource.config.lb.lbmonitor

        }

        private static void deleteGslbServiceMonitor(nitro_service nsService, String monitorName)
                throws ExecutionException {
            try {
                lbmonitor serviceMonitor = lbmonitor.get(nsService, monitorName);
                if (serviceMonitor != null) {
                    lbmonitor.delete(nsService, serviceMonitor);
                }
            } catch (nitro_exception ne) {
                if (ne.getErrorCode() != NitroError.NS_RESOURCE_NOT_EXISTS) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.