コード例 #1
0
        private void checkInstallation()
        {
            CollectorTypeInstaller cti = new CollectorTypeInstaller(Manager.ServerName);

            if (!cti.CheckCollectorTypeInstallStatus("Extended T-SQL Query Collector Type") || !cti.CheckCollectorTypeInstallStatus("Extended XE Reader Collector Type"))
            {
                label1.Text        = "The extended collector types are not installed.";
                buttonInstall.Text = "Install";
            }
            else
            {
                label1.Text        = "The extended collector types are installed.";
                buttonInstall.Text = "Update";
            }
        }
コード例 #2
0
        private void installCollectorType(String serverName)
        {
            CollectorTypeInstaller cti = new CollectorTypeInstaller(serverName);

            try
            {
                if (!cti.checkPermissions())
                {
                    MessageBox.Show("Permission denied. The collector type can be installed only by a member of the 'sysadmin' fixed server role.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    cti.install();
                    MessageBox.Show("Collector type installed successfully.", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error occurred: " + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }