Exemplo n.º 1
0
        /// <summary>
        /// Application Entry Point
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            // Write Header
            Console.WriteLine("AP.EMC.Isilon.Discovery, ©A.Patrick 2017-2018");
            Console.WriteLine("Discovers EMC Isilon Clusters and Nodes for SCOM.");
            Console.WriteLine("");

            // First Thing is to get the Managment Server Name from the config file (if it exists)
            m_managementServer = GetManagementServer();

            if (File.Exists(m_clusterFileName))
            {
                // Write Discovered Data to SCOM Database ( For Relationships
                log.Info("Creating Inbound Connector to " + m_managementServer + "...");

                // Get Management Group
                SCOM.m_managementGroup = new ManagementGroup(m_managementServer);

                // Create Our Inbound Connector
                SCOM.CreateConnector();

                // Make Sure Connector is initialized
                if (SCOM.m_monitoringConnector.Initialized)
                {
                    // Get Clusters and Nodes
                    log.Info("Starting Cluster & Node Discovery...");
                    GetClustersAndNodes();

                    // Add in Discovery Data
                    foreach (IsilonCluster ic in ClusterList)
                    {
                        discoData.Include(ic.SCOM_Object);
                        foreach (IsilonNode node in ic.NodeList)
                        {
                            discoData.Include(node.SCOM_Object);
                            foreach (IsilonNetworkInterface nif in node.NetworkInterfaceList)
                            {
                                discoData.Include(nif.SCOM_Object);
                            }
                        }
                    }

                    // Get Clusters and Nodes
                    log.Info("Writing Discovery data to " + m_managementServer + "...");
                    discoData.Overwrite(SCOM.m_monitoringConnector);

                    // Free Connector
                    SCOM.m_monitoringConnector.Uninitialize();
                    SCOM.m_monitoringConnector = null;
                }
                else
                {
                    log.Fatal("Couldn't Initialize Inbound SCOM Connector!");
                    if (SCOM.m_monitoringConnector != null)
                    {
                        SCOM.m_monitoringConnector = null;
                    }
                    Environment.Exit(5);
                }
            }
            else
            {
                log.Fatal("Could not find cluster file, " + m_clusterFileName);
                Environment.Exit(5);
            }
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            // Write Header
            Console.WriteLine("AP.VMware.Seed, ©A.Patrick 2018-2019");
            Console.WriteLine("Discovers VMware Virtual Centers for SCOM.");
            Console.WriteLine("");

            // First Thing is to get the Managment Server Name from the config file (if it exists).
            m_managementServer = GetManagementServer();
            log.Info("Using management Server " + m_managementServer);

            // See if Config File Exists
            if (File.Exists(m_vCenterFileName))
            {
                // Log Info
                log.Info("Creating Inbound Connector to " + m_managementServer + "...");

                // Get Management Group
                SCOM.m_managementGroup = new ManagementGroup(m_managementServer);

                // Create Our Inbound Connector
                SCOM.CreateConnector();
                log.Info("Inbound Connector Created to " + m_managementServer + "...");

                // Did it Initialise
                if (SCOM.m_monitoringConnector.Initialized)
                {
                    // Log Progress
                    log.Info("Starting Discovery...");
                    Console.WriteLine();
                    // Get Data from vCenters
                    GetData();

                    // Create Discopvery Data
                    Console.WriteLine();
                    log.Info("Creating Discovery Data...");
                    CreateDiscoveryData();

                    try
                    {
                        // Write Discovered Data to SCOM Database
                        log.Info("Writing Discovery Data to " + m_managementServer);
                        discoData.Overwrite(SCOM.m_monitoringConnector);
                    }
                    catch (Exception ex)
                    {
                        log.Error(ex.Message);
                    }

                    // Uninitialize the connector
                    SCOM.m_monitoringConnector.Uninitialize();
                    SCOM.m_monitoringConnector = null;
                }
                else
                {
                    log.Fatal("Couldn't Initialize Inbound SCOM Connector!");
                }
            }
            else
            {
                log.Fatal("Couldn't Find " + m_vCenterFileName);
                Environment.Exit(5);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Application Entry Point
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            // Write Header
            Console.WriteLine("AP.F5.LTM.Discovery, ©A.Patrick 2017-2018");
            Console.WriteLine("Discovers F5 LTM Classes for SCOM.");
            Console.WriteLine("");

            // First Thing is to get the Managment Server Name from the config file (if it exists).
            m_managementServer = GetManagementServer();

            // Get Devices (If Device File Exists
            if (File.Exists(m_deviceFileName))
            {
                // Write Discovered Data to SCOM Database ( For Relationships
                log.Info("Creating Inbound Connector to " + m_managementServer + "...");

                // Get Management Group
                SCOM.m_managementGroup = new ManagementGroup(m_managementServer);

                // Create Our Inbound Connector
                SCOM.CreateConnector();
                log.Info("Inbound Connector Created..." + m_managementServer + "...");

                // Has Conenctor been created successfully
                if (SCOM.m_monitoringConnector.Initialized)
                {
                    // Log Progress
                    log.Info("Starting Device Discovery...");
                    Console.WriteLine();
                    // Get Devices from SCOM
                    SCOM_DeviceList = new SCOM_Devices();
                    // Get Devices from CSV
                    GetDevices();
                    // Log Progress
                    log.Info(SCOM_DeviceList.Items.Count + " Devices Found in SCOM...");
                    log.Info(DeviceList.Count + " Devices Found in CSV...");
                    Console.WriteLine();

                    // Get Device Groups / Traffic Groups
                    log.Info("Get Device Groups / Traffic Groups from...");
                    GetDeviceGroups();

                    // Create Discovery Data
                    Console.WriteLine();
                    log.Info("Creating Discovery Data...");
                    // Add Data to Discovery Data
                    AddDataToDiscoveryData();
                    // Write Discovery Data
                    log.Info("Writing Discovery Data to " + m_managementServer);
                    discoData.Overwrite(SCOM.m_monitoringConnector);

                    // Write Discovered Relationship Data to SCOM Database
                    Console.WriteLine();
                    log.Info("Creating Relationship Data...");
                    CreateRelationships();
                    // Write Relationship Discovery Data
                    log.Info("Writing Relationship Data to " + m_managementServer);
                    relationshipData.Overwrite(SCOM.m_monitoringConnector);


                    Console.WriteLine();
                }
                else
                {
                    log.Fatal("Couldn't Initialize Inbound SCOM Connector!");
                }

                // Free Connector
                SCOM.m_monitoringConnector.Uninitialize();
                SCOM.m_monitoringConnector = null;
            }
            else
            {
                log.Fatal("Couldn't Initialize Inbound SCOM Connector!");
                Environment.Exit(5);
            }
        }