Package nz.co.abrahams.asithappens.storage

Examples of nz.co.abrahams.asithappens.storage.DataSets


        int[] ifIndices;
        String[] ifDescriptions;
        String portString;
        BandwidthSNMP snmp;
        BandwidthCollector collector;
        DataSets data;
        TimeSeriesContext context;
        DataGraph graphFrame;
       
        if ( ! portsSelectorPanel.getModel().hasEnumerated() ) {
            ErrorHandler.modalError(this, "Please enumerate ports on a device and select a port",
                    "No port selected");
            return;
        } else if ( portsSelectorPanel.rowsSelected().length == 0 ) {
            ErrorHandler.modalError(this, "Please select a port", "No port selected");
            return;
        }
       
        try {
            device = portsSelectorPanel.getModel().getDevice();
            ifIndices = portsSelectorPanel.getIfIndices();
            ifDescriptions = portsSelectorPanel.getIfDescriptions();
            portString = portsSelectorPanel.getPortsString();

            snmp = new BandwidthSNMP(device);
            collector = new BandwidthCollector(snmp, Integer.parseInt(pollField.getText()), ifIndices, ifDescriptions, prefer64BitCheckBox.isSelected());
            data = new DataSets(DataType.BANDWIDTH, collector, device, Integer.parseInt(pollField.getText()), portString, DataSets.DIRECTION_BOTH, null, storeDataCheckBox.isSelected());
            context = new TimeSeriesContext(data);
            graphFrame = new DataGraph(context);
        } catch (DBException e) {
            ErrorHandler.modalError(null, "Please ensure that database is running and accessible",
                    "Error opening database connection", e);
View Full Code Here


    /** Creates a new response graph. */
    private void responseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_responseButtonActionPerformed
        Device device;
        int pollInterval;
        DataCollector collector;
        DataSets data;
        TimeSeriesContext context;
        DataGraph graphFrame;
       
        try {
            //data = new ResponseData(new Device(deviceField.getText()), Integer.parseInt(pollField.getText()) * 1000, "Response Graph", "ms", storeDataCheckBox.isSelected());
            device = new Device(deviceField.getText());
            //pollInterval = Integer.parseInt(pollField.getText()) * 1000;
            pollInterval = Integer.parseInt(pollField.getText());
            if ( Configuration.getProperty("collector.response.class").equals("windows") )
                collector = new ResponseWindowsCollector(device, pollInterval);
            else
                collector = new ResponseCollector(device, pollInterval);
            data = new DataSets(DataType.RESPONSE, collector, device, pollInterval, null, DataSets.DIRECTION_NONE, null, storeDataCheckBox.isSelected());
            context = new TimeSeriesContext(data);
            //graphFrame = new DataGraph(context);
            graphFrame = new DataGraph(context);
        } catch (DBException e) {
            ErrorHandler.modalError(null, "Please ensure that database is running and accessible",
View Full Code Here

        storagePane.setViewportView(new javax.swing.JList());
    }//GEN-LAST:event_collectorTypeComboBoxActionPerformed
   
    private void storageButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_storageButtonActionPerformed
        DataCollector collector;
        DataSets data;
        TimeSeriesContext context;
        DataGraph graphFrame;
        int storageIndex;
        String storageString;
        Device currentDevice;
        MemoryUCDSNMP memoryUCDSNMP;
        int pollInterval;
       
        pollInterval = Integer.parseInt(pollField.getText());
        //pollInterval = Integer.parseInt(pollField.getText()) * 1000;
        if ( collectorTypeComboBox.getSelectedIndex() == COLLECTOR_TYPE_HR ) {
            try {
                storageIndex = memoryHRSNMP.getStorageIndex()[((JList)(storagePane.getViewport().getView())).getSelectedIndex()];
                storageString = (String)((JList)storagePane.getViewport().getView()).getSelectedValue();
                collector = new MemoryHRCollector(memoryHRSNMP, pollInterval, storageIndex);
                data = new DataSets(DataType.STORAGE, collector, device, pollInterval, storageString, DataSets.DIRECTION_NONE, null, storeDataCheckBox.isSelected());
                context = new TimeSeriesContext(data);
                graphFrame = new DataGraph(context);
            } catch (NullPointerException e) {
                ErrorHandler.modalError(this, "Please enumerate resources on a device and select a storage object",
                        "No storage object selected");
            } catch (ArrayIndexOutOfBoundsException e) {
                ErrorHandler.modalError(this, "Please select a storage object", "No storage object selected");
            } catch (DBException e) {
                ErrorHandler.modalError(null, "Please ensure that database is running and accessible",
                        "Error opening database connection", e);
            } catch (UnknownHostException e) {
                ErrorHandler.modalError(null, "Please ensure that device name \"" + deviceField.getText() + "\" is valid",
                        "Unknown host " + deviceField.getText());
            } catch (SNMPException e) {
                ErrorHandler.modalError(null, "Please ensure that device name and community string are correct",
                        "Cannot access SNMP service on device " + deviceField.getText(), e);
            }
        }
       
        else if ( collectorTypeComboBox.getSelectedIndex() == COLLECTOR_TYPE_UCD ) {
            try {
                storageIndex = ((JList)(storagePane.getViewport().getView())).getSelectedIndex();
                storageString = (String)((JList)storagePane.getViewport().getView()).getSelectedValue();
                //currentDevice = new Device(deviceField.getText(), communityField.getText());
                memoryUCDSNMP = new MemoryUCDSNMP(device);
                collector = new MemoryUCDCollector(memoryUCDSNMP, pollInterval, storageIndex);
                data = new DataSets(DataType.STORAGE, collector, device, pollInterval, storageString, DataSets.DIRECTION_NONE, null, storeDataCheckBox.isSelected());
                context = new TimeSeriesContext(data);
                graphFrame = new DataGraph(context);
            } catch (NullPointerException e) {
                ErrorHandler.modalError(this, "Please enumerate resources on a device and select a memory type",
                        "No memory type selected");
            } catch (ArrayIndexOutOfBoundsException e) {
                ErrorHandler.modalError(this, "Please select a memory type", "No memory type selected");
            } catch (DBException e) {
                ErrorHandler.modalError(null, "Please ensure that database is running and accessible",
                        "Error opening database connection", e);
            } catch (UnknownHostException e) {
                ErrorHandler.modalError(null, "Please ensure that device name \"" + deviceField.getText() + "\" is valid",
                        "Unknown host " + deviceField.getText());
            } catch (SNMPException e) {
                ErrorHandler.modalError(null, "Please ensure that device name and community string are correct",
                        "Cannot access SNMP service on device " + deviceField.getText(), e);
            }
        }
       
        else if ( collectorTypeComboBox.getSelectedIndex() == COLLECTOR_TYPE_CISCO ) {
            try {
                storageIndex = memoryCiscoSNMP.getStorageIndex()[((JList)(storagePane.getViewport().getView())).getSelectedIndex()];
                storageString = (String)((JList)storagePane.getViewport().getView()).getSelectedValue();
                //currentDevice = new Device(deviceField.getText(), communityField.getText());
                collector = new MemoryCiscoCollector(memoryCiscoSNMP, pollInterval, storageIndex);
                data = new DataSets(DataType.STORAGE, collector, device, pollInterval, storageString, DataSets.DIRECTION_NONE, null, storeDataCheckBox.isSelected());
                context = new TimeSeriesContext(data);
                graphFrame = new DataGraph(context);
            } catch (NullPointerException e) {
                ErrorHandler.modalError(this, "Please enumerate resources on a Cisco device and select a memory pool",
                        "No memory pool selected");
View Full Code Here

    }//GEN-LAST:event_storageButtonActionPerformed
   
    /** Creates a new processor graph. */
    private void processorButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_processorButtonActionPerformed
        DataCollector collector;
        DataSets data;
        TimeSeriesContext context;
        DataGraph graphFrame;
        int processorIndex;
        String processorString;
        Device currentDevice;
        ProcessorUCDSNMP processorUCDSNMP;
        ProcessorCiscoSNMP processorCiscoSNMP;
        int pollInterval;
       
        //pollInterval = Integer.parseInt(pollField.getText()) * 1000;
        pollInterval = Integer.parseInt(pollField.getText());
        if ( collectorTypeComboBox.getSelectedIndex() == COLLECTOR_TYPE_HR ) {
           
            try {
                processorIndex = processorHRSNMP.getProcessorsIndex()[((JList)(processorsPane.getViewport().getView())).getSelectedIndex()];
                processorString = (String)((JList)processorsPane.getViewport().getView()).getSelectedValue();
                collector = new ProcessorHRCollector(processorHRSNMP, pollInterval, processorIndex);
                data = new DataSets(DataType.PROCESSOR, collector, device, pollInterval, processorString, DataSets.DIRECTION_NONE, null, storeDataCheckBox.isSelected());
                context = new TimeSeriesContext(data);
                graphFrame = new DataGraph(context);
            } catch (NullPointerException e) {
                ErrorHandler.modalError(this, "Please enumerate resources on a device and select a processor",
                        "No processor selected");
            } catch (ArrayIndexOutOfBoundsException e) {
                ErrorHandler.modalError(this, "Please select a processor", "No processor selected");
            } catch (DBException e) {
                ErrorHandler.modalError(null, "Please ensure that database is running and accessible",
                        "Error opening database connection", e);
            } catch (UnknownHostException e) {
                ErrorHandler.modalError(null, "Please ensure that device name \"" + deviceField.getText() + "\" is valid",
                        "Unknown host " + deviceField.getText());
            } catch (SNMPException e) {
                ErrorHandler.modalError(null, "Please ensure that device name and community string are correct",
                        "Cannot access SNMP service on device " + deviceField.getText(), e);
            } catch (ClassCastException e) {
                ErrorHandler.modalError(null, "Please ensure that device supports processor usage in the Host Resources MIB",
                        "Cannot find processor usage information on device " + deviceField.getText(), e);
            }
           
        } else if ( collectorTypeComboBox.getSelectedIndex() == COLLECTOR_TYPE_UCD ) {
            try {
                currentDevice = new Device(deviceField.getText(), communityField.getText(), null, false);
                processorUCDSNMP = new ProcessorUCDSNMP(currentDevice);
                collector = new ProcessorUCDCollector(processorUCDSNMP, (long)pollInterval);
                data = new DataSets(DataType.NETSNMP_PROCESSOR, collector, currentDevice, pollInterval, null, DataSets.DIRECTION_NONE, null, storeDataCheckBox.isSelected());
                context = new TimeSeriesContext(data);
                graphFrame = new DataGraph(context);
            } catch (DBException e) {
                ErrorHandler.modalError(null, "Please ensure that database is running and accessible",
                        "Error opening database connection", e);
            } catch (UnknownHostException e) {
                ErrorHandler.modalError(null, "Please ensure that device name \"" + deviceField.getText() + "\" is valid",
                        "Unknown host " + deviceField.getText());
            } catch (SNMPException e) {
                ErrorHandler.modalError(null, "Please ensure that device name and community string are correct",
                        "Cannot access SNMP service on device " + deviceField.getText(), e);
            }
        } else if ( collectorTypeComboBox.getSelectedIndex() == COLLECTOR_TYPE_CISCO ) {
            try {
                currentDevice = new Device(deviceField.getText(), communityField.getText(), null, false);
                processorCiscoSNMP = new ProcessorCiscoSNMP(currentDevice);
                collector = new ProcessorCiscoCollector(processorCiscoSNMP, pollInterval);
                data = new DataSets(DataType.PROCESSOR, collector, currentDevice, pollInterval, null, DataSets.DIRECTION_NONE, null, storeDataCheckBox.isSelected());
                context = new TimeSeriesContext(data);
                graphFrame = new DataGraph(context);
            } catch (DBException e) {
                ErrorHandler.modalError(null, "Please ensure that database is running and accessible",
                        "Error opening database connection", e);
View Full Code Here

        int ifIndex;
        String portString;
        FlowOptions options;
        NetFlowSNMP snmp;
        NetFlowCollector collector;
        DataSets data;
        TimeSeriesContext context;
        DataGraph graphFrame;
       
        if ( ! portsSelectorPanel.getModel().hasEnumerated() ) {
            ErrorHandler.modalError(this, "Please enumerate ports on a device and select a port",
                    "No port selected");
            return;
        } else if ( portsSelectorPanel.rowsSelected().length == 0 ) {
            ErrorHandler.modalError(this, "Please select a port", "No port selected");
            return;
        }
       
        device = portsSelectorPanel.getModel().getDevice();
        try {
            snmp = new NetFlowSNMP(device);
            if ( snmp.getNetFlowTopFlowsTopNTable() > 0 ) {
                logger.debug("NetFlow Top-N table already exists");
                if ( JOptionPane.showConfirmDialog(this, "A Netflow Top-N table already exists - overwrite this?",
                        "Confirm NetFlow Top-N table creation", JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE) == JOptionPane.CANCEL_OPTION)
                    return;
            }
            /*
            ifIndex = device.getPortsIndex()[((JList)(portsPane.getViewport().getView())).getSelectedIndex()];
            portString = (String)((JList)portsPane.getViewport().getView()).getSelectedValue();
             */
            ifIndex = portsSelectorPanel.getIfIndex();
            portString = portsSelectorPanel.getIfDescription();
            options = new FlowOptions(ipProtocolCheckBox.isSelected(), sourceAddressCheckBox.isSelected(),
                    destinationAddressCheckBox.isSelected(), tosCheckBox.isSelected(), sourcePortCheckBox.isSelected(), destinationPortCheckBox.isSelected());
           
            collector = new NetFlowCollector(snmp, ifIndex, portString, directionCombo.getSelectedIndex() + 1, Configuration.getPropertyInt("collector.netflow.table.size"), Integer.parseInt(pollField.getText()) * 1000, criteria, options);
            data = new DataSets(DataType.NETFLOW, collector, device, Integer.parseInt(pollField.getText()) * 1000, portString, directionCombo.getSelectedIndex() + 1, null, storeDataCheckBox.isSelected());
            //data = new DataSets(3, device, Integer.parseInt(pollField.getText()) * 1000, ifIndex, portString, directionCombo.getSelectedIndex() + 1, "NetFlow Graph", storeDataCheckBox.isSelected());
            context = new TimeSeriesContext(data);
            graphFrame = new DataGraph(context);
        } catch (DBException e) {
            ErrorHandler.modalError(this, "Please ensure that database is running and accessible",
View Full Code Here

        Device device;
        int ifIndex;
        String portString;
        NBARSNMP snmp;
        NBARCollector collector;
        DataSets data;
        TimeSeriesContext context;
        DataGraph graphFrame;
       
        if ( ! portsSelectorPanel.getModel().hasEnumerated() ) {
            ErrorHandler.modalError(this, "Please enumerate ports on a device and select a port",
                    "No port selected");
            return;
        } else if ( portsSelectorPanel.rowsSelected().length == 0 ) {
            ErrorHandler.modalError(this, "Please select a port", "No port selected");
            return;
        }
       
        device = portsSelectorPanel.getModel().getDevice();
        try {
            /*
            ifIndex = device.getPortsIndex()[((JList)(portsPane.getViewport().getView())).getSelectedIndex()];
            portString = (String)((JList)portsPane.getViewport().getView()).getSelectedValue();
             */
           
            ifIndex = portsSelectorPanel.getIfIndex();
            portString = portsSelectorPanel.getIfDescription();
            snmp = new NBARSNMP(device);
            collector = new NBARCollector(snmp, Integer.parseInt(pollField.getText()) * 1000, ifIndex, portString, directionCombo.getSelectedIndex() + 1, Configuration.getPropertyInt("collector.nbar.table.size"));
            data = new DataSets(DataType.NBAR, collector, device, Integer.parseInt(pollField.getText()) * 1000, portString, directionCombo.getSelectedIndex() + 1, null, storeDataCheckBox.isSelected());
            context = new TimeSeriesContext(data);
            graphFrame = new DataGraph(context);
        } catch (DBException e) {
            ErrorHandler.modalError(null, "Please ensure that database is running and accessible",
                    "Error opening database connection", e);
View Full Code Here

        this.finishTime = finishTime;
        //this.dataTypeID = dataTypeID;
        this.aggregation = aggregation;
        this.interpolation = interpolation;
       
        dataSets = new DataSets();
    }
View Full Code Here

        int ifIndex;
        String portString;
        Vector<CustomOID> oids;
        CustomOIDSNMP snmp;
        CustomOIDCollector collector;
        DataSets data;
        TimeSeriesContext context;
        DataGraph graphFrame;


        if ( oidTable.getRowCount() == 0 ) {
            ErrorHandler.modalError(this, "Please add at least one OID to the table",
                    "No OIDs added");
            return;
        }
       

        deviceName = deviceField.getText();
        oids = ((CustomOIDTableModel)oidTable.getModel()).getCustomOIDVector();
        try {
            device = new Device(deviceName, communityField.getText(), null, false);
            snmp = new CustomOIDSNMP(device);
            collector = new CustomOIDCollector(snmp, Integer.parseInt(pollField.getText()), unitsField.getText(), ((CustomOIDTableModel) oidTable.getModel()).getCustomOIDVector());
            data = new DataSets(DataType.OID, collector, device, Integer.parseInt(pollField.getText()), null, 0, null, storeDataCheckBox.isSelected());
            for (int i = 0; i < oids.size(); i++) {
                data.addSet(oids.elementAt(i).label);
            }
            context = new TimeSeriesContext(data);
            graphFrame = new DataGraph(context);
        } catch (DBException e) {
            ErrorHandler.modalError(null, "Please ensure that database is running and accessible",
View Full Code Here

TOP

Related Classes of nz.co.abrahams.asithappens.storage.DataSets

Copyright © 2018 www.massapicom. 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.