예제 #1
0
        public static string getCustomComponentsInstalled()
        {
            string intalledComponents = null;

            try
            {
                RegistryKey rk = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Mercury Interactive\LoadRunner\CustComponent\");
                if (rk != null)
                {
                    foreach (string subKeyName in rk.GetSubKeyNames())
                    {
                        RegistryKey subKey = rk.OpenSubKey(subKeyName + @"\CurrentVersion");
                        if (subKey != null)
                        {
                            intalledComponents += Html.B(subKeyName) + " " + subKey.GetValue("Major").ToString() + "." + subKey.GetValue("Minor").ToString() + Html.br;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Html.Error(ex.ToString());
            }
            return(intalledComponents);
        }
예제 #2
0
 public MagentCollectorHelper()
 {
     try
     {
         // check if LR/PC agent is installed as a service
         isAgentInstalledAsService = IsAgentServiceInstalledAndRunning(lrAgentServiceCaption) || IsAgentServiceInstalledAndRunning(pcAgentServiceCaption);
         // check if LR/PC agent is installed as a process
         isAgentInstalledAsProcess = IsAgentProcessInstalled(lrAgentProcessCaption) || IsAgentProcessInstalled(pcAgentProcessCaption);
         //check if LR/PC agent process is running
         isAgentProcessRunning = IsAgentRunning(agentProcessName);
         //if the procses is running get the ports it is using
         if (isAgentProcessRunning)
         {
             AgentProcessOpenedPorts = Html.br + Html.B("Details:") + Html.br + GetOpenedPortsInfo();
         }
         //check if agent is running as a service only if it is installed as a service
         //to avoid confusion with diagnostics agent which has the same name
         if (isAgentInstalledAsService)
         {
             if (isAgentServiceRunning)
             {
                 numberOfRunningAgents   = 1;
                 AgentServiceOpenedPorts = Html.br + Html.B("Details:") + Html.br + GetOpenedPortsInfo();
             }
         }
     }
     catch (Exception ex)
     {
         Logger.Error(ex.ToString());
     }
 }
예제 #3
0
        private string GetCustomComponentsInstalled()
        {
            StringBuilder intalledComponents = new StringBuilder(1024);

            try
            {
                string      keyPath = this.ProductRegistryPath + @"CustComponent\";
                RegistryKey rk      = Registry.LocalMachine.OpenSubKey(keyPath);

                foreach (string subKeyName in rk.GetSubKeyNames())
                {
                    RegistryKey subKey = rk.OpenSubKey(subKeyName + @"\CurrentVersion");
                    if (subKey != null)
                    {
                        intalledComponents.Append(Html.B(subKeyName) + " " + subKey.GetValue("Major").ToString() + "." + subKey.GetValue("Minor").ToString() + Html.br);
                    }
                }
                return(intalledComponents.ToString());
            }
            catch (Exception ex)
            {
                Logger.Warn(ex.ToString());
                return(null);
            }
        }
예제 #4
0
        public static string GetROPortMapping()
        {
            StringBuilder output = new StringBuilder();

            output.Append(Html.br + Html.br + Html.B("Network > Port Mapping") + Html.br);
            try
            {
                string protocolsKey = @"Software\Mercury Interactive\LoadRunner\Protocols\";
                string sockets      = RegistryWrapper.GetValue(RegHive.CurrentUser, protocolsKey + @"WPlus\Analyzer", "EnableSocketLevelTrappingForWeb", "1");
                string wininet      = RegistryWrapper.GetValue(RegHive.CurrentUser, protocolsKey + @"HTTP\Analyzer", "EnableWinINetTrapForWeb", "0");

                string captureLevel = "Socket level data";
                if (sockets == "1" && wininet == "1")
                {
                    captureLevel = "Socket level and WinINet level data";
                }
                else if (wininet == "1")
                {
                    captureLevel = "WinINet level data";
                }

                output.Append(Html.IndentWithSpaces() + "Capture level: " + captureLevel + Html.br);
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
            }
            return(output.ToString());
        }
예제 #5
0
        public static string GetHardDrivesInformation()
        {
            try
            {
                DriveInfo[] allDrives = DriveInfo.GetDrives();
                string      driveInfo = null;

                foreach (DriveInfo d in allDrives)
                {
                    // get only the fixed drives i.e. no network drives, no cdroms
                    if (d.DriveType.ToString() == "Fixed")
                    {
                        driveInfo += Html.B("Drive: " + d.Name) + Html.br;
                        //driveInfo += "File type: " + d.DriveType + "<br />";

                        if (d.IsReady == true)
                        {
                            //driveInfo += "Volume label: " + d.VolumeLabel + "<br />";
                            //driveInfo += "File system: " + d.DriveFormat + "<br />";
                            //driveInfo += "Free space: " + d.AvailableFreeSpace + " bytes <br />" ;
                            driveInfo += "Total size of drive: " + (Convert.ToInt64(d.TotalSize) / (1024 * 1024)).ToString() + " Mb" + Html.br;
                            driveInfo += "Total available space: " + (Convert.ToInt64(d.TotalFreeSpace) / (1024 * 1024)).ToString() + " Mb" + Html.br;
                        }
                    }
                }

                return(driveInfo);
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
                return(Html.ErrorMsg());
            }
        }
예제 #6
0
        /// <summary>
        /// Method to get a HTML formated list of all patches installed for current product
        /// </summary>
        /// <returns> HTML formated string with all patches installed <returns>
        /// <seealso cref="getPatchesCodes()">
        /// See also the getPatchesCodes method </seealso>
        private string GetPatchesInstalled()
        {
            try
            {
                //Stopwatch stopWatch = Stopwatch.StartNew();
                List <string> patchesCodes     = GetPatchesCodes();
                StringBuilder patchesInstalled = new StringBuilder();

                if (patchesCodes != null)
                {
                    foreach (string patchCode in patchesCodes)
                    {
                        //TODO this check might be unnecessarry
                        if (patchCode != "Patches")
                        {
                            string keyPath       = MSIPatchesRegPath + patchCode;
                            string dateInstalled = Helper.ConvertInstallDate(RegistryWrapper.GetValue(RegHive.LocalMachine, keyPath, "Installed"));
                            string displayName   = RegistryWrapper.GetValue(RegHive.LocalMachine, keyPath, "DisplayName");

                            patchesInstalled.Append(Html.B(displayName) + " " + dateInstalled + Html.br);
                        }
                    }
                    return(patchesInstalled.ToString());
                }
                return(null);
            }
            catch (Exception ex)
            {
                Logger.Warn(ex.ToString());
                return(null);
            }
        }
            internal static string GetCitrixRecOptions()
            {
                StringBuilder output = new StringBuilder();

                try
                {
                    output.Append(Html.B("Configuration") + Html.br);
                    output.Append(Html.IndentWithSpaces() + "Encryption Level: " + ini.GetSetting("Citrix", "Enctyption") + Html.br);
                    output.Append(Html.IndentWithSpaces() + "Window size: " + ini.GetSetting("Citrix", "Window") + Html.br);

                    output.Append(Html.B("Recorder") + Html.br);
                    output.Append(Html.IndentWithSpaces() + "Window name: " + VugenProtocolsCollectorHelper.Citrix.GetCitrixWindowNameOption("CommonNames", "NAMES") + Html.br);
                    output.Append(Html.CheckBox(ini.GetBoolSetting("BITMAPS", "SaveBitmaps", true)) + "Save snapshots");

                    output.Append(Html.br + Html.B("Code Generation") + Html.br);
                    output.Append(Html.CheckBox(ini.GetBoolSetting("AGENT", "UseAgent", true)) + "Use Citrix agent input in Code Generation" + Html.br);
                    output.Append(Html.CheckBox(ini.GetBoolSetting("AGENT", "SyncOnText", false)) + "Automatically generate text synchronization calls " + Html.br);
                }
                catch (Exception ex)
                {
                    Logger.Error(ex.ToString());
                    return(Html.Error(ex.ToString()));
                }
                return(output.ToString());
            }
예제 #8
0
        /// <summary>
        /// Get the list of install level service providers
        /// and put them into a <div></div> element
        /// </summary>
        /// <param name="id">the id of the wrapping element</param>
        /// <returns></returns>
        public static string GetInstalledLSPs()
        {
            try
            {
                string output = Helper.ExecuteCMDCommand("netsh winsock show catalog");

                StringBuilder info = new StringBuilder(128);

                // split the output by \r\n
                char[]      delimiter = new Char[] { '\t', '\r', '\n' };
                string[]    parts     = output.Split(delimiter, StringSplitOptions.RemoveEmptyEntries);
                CultureInfo ci        = CultureInfo.CurrentUICulture;
                string      lang      = ci.TwoLetterISOLanguageName;
                Logger.Info("Detected system language: " + lang);
                //check for English, German or French syntax
                string description = String.Empty;
                string provider    = String.Empty;
                switch (lang)
                {
                case "fr":
                    description = "Description ";
                    provider    = "Chemin d'accŠs fournisseur "; //Chemin d'accŠs fournisseur
                    break;

                case "de":
                    description = "Beschreibung";
                    provider    = "Anbieterpfad";
                    break;

                case "es":
                    description = "Descripci¢n";
                    provider    = "Ruta de proveedor";
                    break;

                default:
                    description = "Description";
                    provider    = "Provider Path";
                    break;
                }

                for (int i = 0; i < parts.Length; i++)
                {
                    if (parts[i].StartsWith(description))
                    {
                        info.Append("\t\t\t" + Html.B(parts[i].Substring(description.Length + 1)));
                    }

                    if (parts[i].StartsWith(provider))
                    {
                        info.Append(" provided by " + parts[i].Substring(provider.Length + 1) + Html.br + "\n");
                    }
                }
                return(info.ToString());
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
                return(Html.ErrorMsg());
            }
        }
예제 #9
0
        public override string ToString()
        {
            StringBuilder ro = new StringBuilder();

            if (this.currentUserSettingsExist)
            {
                ro.Append(DetectRecordingOptions.GetROScriptGeneral());
                ro.Append(DetectRecordingOptions.GetROScriptLevel());
                //if vugen is not earlier than 11.50 (if Vugen is earlier then CompareTo returns -1)
                if (ProductDetection.Vugen.isNew)
                {
                    ro.Append(DetectRecordingOptions.GetROCodeGen());
                }
                ro.Append(DetectRecordingOptions.GetROPortMapping());
                ro.Append(DetectRecordingOptions.GetROPortMappingServers());
                ro.Append(DetectRecordingOptions.GetROPortMappingOptions());
                ro.Append(DetectRecordingOptions.GetROHttpProperties());

                //if vugen is not earlier than 11.50
                if (ProductDetection.Vugen.isNew)
                {
                    ro.Append(DetectRecordingOptions.GetROCorrelationConfig());
                }
                ro.Append(DetectRecordingOptions.GetRODataFormat());
            }
            else
            {
                ro.Append("No settings found for current user " + Html.B(Environment.UserName));
            }

            return(ro.ToString());
        }
예제 #10
0
        public override string ToString()
        {
            StringBuilder output = new StringBuilder();
            //Create HTML checkbox
            var el = new HtmlElement("input");

            el.Attributes.Add("type", "checkbox");
            el.Attributes.Add("checked", enabled ? "checked" : "");

            string ruleText;

            if (isRegex)
            {
                ruleText = " Regex rule: " + lb;
            }
            else if (isXpath)
            {
                ruleText = " Xpath rule: " + lb;
            }
            else
            {
                ruleText = " LB=\"" + lb + "\" RB=\"" + rb + "\"";
            }

            output.Append(Html.IndentWithSpaces(8));
            output.Append(el.ToString() + Html.B(name) + ruleText);

            return(output.ToString());
        }
예제 #11
0
        public static string GetServiceInfo(string serviceName, string processName = "")
        {
            try
            {
                if (processName == "")
                {
                    processName = serviceName;
                }

                int    agentProcessId     = 0;
                string agentProcessOwnder = string.Empty;
                string agentProcessPath   = string.Empty;


                ServiceController sc = new ServiceController(serviceName);

                Logger.Info("status " + serviceName + sc.Status);
                switch (sc.Status)
                {
                case ServiceControllerStatus.Running:
                case ServiceControllerStatus.StartPending:
                case ServiceControllerStatus.StopPending:
                    string processId = Helper.QueryWMI("ProcessId", "root\\CIMV2", "Win32_Service", "WHERE Name='" + serviceName + "'");
                    Logger.Info("ProcessId for  " + processName + " is " + processId);
                    if (!processId.Contains("Error") && !processId.Contains("Not detected"))
                    {
                        agentProcessId     = Convert.ToInt32(processId);
                        agentProcessOwnder = Helper.GetProcessOwner(agentProcessId);
                    }
                    agentProcessPath = Helper.QueryWMI("PathName", "root\\CIMV2", "Win32_Service", "WHERE Name='" + serviceName + "'");
                    Logger.Info("agentProcessPath for  " + processName + " is " + agentProcessPath);
                    break;

                case ServiceControllerStatus.Stopped:
                case ServiceControllerStatus.Paused:
                    break;
                }


                var status = sc.Status.ToString().Contains("Running") ? Html.Notice(sc.Status.ToString()) : sc.Status.ToString();
                status = status.Contains("Stopped") || status.Contains("Paused") ? Html.Error(status) : status;

                var openedPorts = agentProcessId != 0 ? Helper.GetOpenedPortsForProcessId(agentProcessId) : "";

                return("Status: " + status + Html.br
                       + Html.B("Details: ") + Html.br
                       + Html.U("PID: " + agentProcessId + " " + agentProcessOwnder) + Html.br
                       + "Path: " + agentProcessPath + openedPorts);
            }
            catch (InvalidOperationException)
            {
                return(Html.Warning("Service not installed on this computer!"));
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
                return(ex.ToString());
            }
        }
            public static string GetFlexRoInfo()
            {
                try
                {
                    StringBuilder output = new StringBuilder();

                    output.Append(Html.B("Flex > RTMP") + Html.br);
                    output.Append(Html.CheckBox(ini.GetBoolSetting("RTMP_RO", "GenerateReceiveStream", true)) + "Generate single step for RTMP/T stream handling" + Html.br);

                    output.Append(Html.B("Flex > Configuration") + Html.br);
                    bool useExternalVm = ini.GetBoolSetting("FLEX_RO", "UseExternalVm", false);
                    output.Append(Html.CheckBox(useExternalVm) + "Use external JVM" + Html.br);
                    int indentLevel = 8;
                    if (useExternalVm)
                    {
                        output.Append(Html.IndentWithSpaces(indentLevel) + "External JVM path: " + ini.GetSetting("FLEX_RO", "ExternalVmPath", "") + Html.br);
                    }

                    output.Append(Html.CheckBox(ini.GetBoolSetting("FLEX_RO", "ExternalDsParser", false)) + "Use GraniteDS configuration" + Html.br);
                    output.Append(Html.IndentWithSpaces(indentLevel) + "Maximum formatted Request/Response size to print (in characters): " + ini.GetSetting("FLEX_RO", "MaxReqResSizeToWriteForLog") + Html.br);

                    output.Append(Html.B("Flex > Externalizable objects") + Html.br);

                    bool EncodeExternalizableObject = ini.GetBoolSetting("FLEX_RO", "EncodeExternalizableObject", false);
                    output.Append(Html.CheckBox(!EncodeExternalizableObject) + "Do not serialize externalizable objects" + Html.br);
                    if (EncodeExternalizableObject == true)
                    {
                        output.Append(Html.CheckBox(true) + "Serialize objects using:" + Html.br);
                        bool UseServerParserToParseAmf3 = ini.GetBoolSetting("FLEX_RO", "UseServerParserToParseAmf3", false);

                        bool isCheckBoxDisabled = false;
                        output.Append(Html.CheckBox(!UseServerParserToParseAmf3, isCheckBoxDisabled, indentLevel) + "LoadRunner AMF serializer" + Html.br);

                        isCheckBoxDisabled = UseServerParserToParseAmf3 ? false : true;
                        output.Append(Html.CheckBox(UseServerParserToParseAmf3, isCheckBoxDisabled, indentLevel) + "Custom Java classes" + Html.br);

                        indentLevel = 12;
                        output.Append(Html.CheckBox(ini.GetBoolSetting("FLEX_RO", "UseFlexGlobalJars", false), isCheckBoxDisabled, indentLevel) + "Use Flex LCDS/BlazeDS jars" + Html.br);
                        bool UseAdditionalJars = ini.GetBoolSetting("FLEX_RO", "UseAdditionalJars", false);

                        string additionalJarsList = "";
                        if (UseAdditionalJars)
                        {
                            additionalJarsList = Html.AddLinkToHiddenContent(GetFlexAdditionalJarFilesInfo(isCheckBoxDisabled));
                        }

                        output.Append(Html.CheckBox(UseAdditionalJars, isCheckBoxDisabled, indentLevel) + "Use additional jars " + additionalJarsList + Html.br);
                    }

                    output.Append(Html.br + ini.GetSetting("FLEX_RO", "FlexJvmParams") + Html.br);

                    return(output.ToString());
                }
                catch (Exception ex)
                {
                    Logger.Error(ex.ToString());
                    return(Html.Error(ex.Message) + Html.br);
                }
            }
            public static string GetDotNetRecOptions()
            {
                StringBuilder output = new StringBuilder();

                try
                {
                    output.Append(Html.B("Microsoft .NET > Recording") + Html.br);
                    output.Append(Html.IndentWithSpaces() + Html.B("Application launch") + Html.br);
                    string iniSection = "General";
                    output.Append(Html.CheckBox(ini.GetBoolSetting(iniSection, "InvasiveAnyCpuRecording", false), false, 6) + "Modify .NET 'Any CPU' type executable files before recording." + Html.br);

                    output.Append(Html.IndentWithSpaces() + Html.B("Support for previous .NET versions") + Html.br);
                    output.Append(Html.CheckBox(ini.GetBoolSetting(iniSection, "EnableV2Emulation", false), false, 6) + "Emulate previous .NET version in transport level" + Html.br);

                    output.Append(Html.IndentWithSpaces() + Html.B("Logging") + Html.br);
                    output.Append(Html.IndentWithSpaces(6) + "Log severity: " + ini.GetSetting(iniSection, "LogSeverity") + Html.br);
                    output.Append(Html.CheckBox(ini.GetBoolSetting(iniSection, "InstrumentationLog", false), false, 6) + "Instrumentation log" + Html.br);
                    output.Append(Html.CheckBox(ini.GetBoolSetting(iniSection, "RecordLog", false), false, 6) + "Recording log" + Html.br);
                    output.Append(Html.CheckBox(ini.GetBoolSetting(iniSection, "CodeGenLog", false), false, 6) + "Code generation log" + Html.br);

                    output.Append(Html.IndentWithSpaces() + Html.B("Serialization") + Html.br);
                    output.Append(Html.IndentWithSpaces(6) + "Serialization format: " + ini.GetSetting(iniSection, "SerializationFormat", "Binary") + Html.br);
                    output.Append(Html.CheckBox(ini.GetBoolSetting(iniSection, "SerializeLongArray", false), false, 6) + "Serialize long arrays" + Html.br);
                    output.Append(Html.IndentWithSpaces(8) + "Treshold value for long array size: " + ini.GetSetting(iniSection, "MaxArrayLength", "32") + Html.br);

                    output.Append(Html.IndentWithSpaces() + Html.B("Remote Objects") + Html.br);
                    output.Append(Html.CheckBox(ini.GetBoolSetting("Remoting", "RecordInprocProxy", false), false, 6) + "Record in-process objects" + Html.br);


                    output.Append(Html.IndentWithSpaces(6) + Html.B("Asynchronous calls") + Html.br);
                    output.Append(Html.CheckBox(ini.GetBoolSetting(iniSection, "RecordOriginalCallbackByDefault", false), false, 6) + "Call original callstack by default" + Html.br);
                    output.Append(Html.CheckBox(ini.GetBoolSetting(iniSection, "GenerateAsyncCallback", true), false, 6) + "Generate asynchronous callbacks" + Html.br);

                    output.Append(Html.IndentWithSpaces(6) + Html.B("WCF duplex binding") + Html.br);
                    output.Append(Html.CheckBox(ini.GetBoolSetting(iniSection, "GenerateDummyDuplexCallback", true), false, 6) + "Generate dummy callback handler" + Html.br);
                    output.Append(Html.CheckBox(ini.GetBoolSetting(iniSection, "GenerateUniqueClientBaseAddress", true), false, 6) + "Generate unique client based address" + Html.br);

                    output.Append(Html.IndentWithSpaces() + Html.B("Debug Options") + Html.br);
                    output.Append(Html.CheckBox(ini.GetBoolSetting("Debug", "StackTrace", true), false, 6) + "StackTrace" + Html.br);
                    output.Append(Html.IndentWithSpaces(6) + "Stack trace limit: " + ini.GetSetting("Debug", "StackTraceLimit", "20") + Html.br);

                    output.Append(Html.IndentWithSpaces() + Html.B("Filters") + Html.br);
                    output.Append(Html.CheckBox(ini.GetBoolSetting(iniSection, "IgnoreAllAssemblies", false), false, 6) + "Ignore all assemblies by default" + Html.br);

                    output.Append(Html.IndentWithSpaces() + Html.B("Code generation") + Html.br);
                    output.Append(Html.CheckBox(ini.GetBoolSetting(iniSection, "ShowWarnings", true), false, 6) + "Show warnings" + Html.br);
                    output.Append(Html.CheckBox(ini.GetBoolSetting(iniSection, "ShowStackTrace", false), false, 6) + "Show stack trace" + Html.br);
                    output.Append(Html.CheckBox(ini.GetBoolSetting(iniSection, "GenerateNewSubscribers", false), false, 6) + "Show all events subscriptions" + Html.br);
                }
                catch (Exception ex)
                {
                    Logger.Error(ex.ToString());
                    return(ex.ToString());
                }
                return(output.ToString());
            }
예제 #14
0
        public static string GetBPMInstallationInfoFromUninstaller()
        {
            Logger.Info("GetBPMInstallationInfoFromUninstaller");
            // Check if BPM is installed
            var bpm = InstalledProgramsHelper.GetInstalledProgramByName(new System.Text.RegularExpressions.Regex("HP Business Process Monitor"));

            if (bpm != null)
            {
                return(String.Format("Yes, {0} {1}", Html.B(bpm.DisplayName), bpm.DisplayVersion));
            }
            return("No");
        }
예제 #15
0
        public static string GetROCodeGen()
        {
            StringBuilder output = new StringBuilder();

            output.Append(Html.br + Html.B("General > Code Generation") + Html.br);
            output.Append(Html.IndentWithSpaces() + "Code generation process includes:" + Html.br);

            string textValue = CorrelationConfigurationHelper.Settings["ScanAfterCodeGeneration"].ToString();

            output.Append(Html.CheckBox(textValue == "True", true, 8) + "Correlations scan");

            return(output.ToString());
        }
예제 #16
0
        public static string UACInfo()
        {
            switch (UACLevel)
            {
            case 0:
                return("Disabled");

            case 1:
                return(Html.Error(Html.B("Enabled")));

            default:
                return("UAC is not supported for this OS");
            }
        }
예제 #17
0
        /// <summary>
        /// Method to execute netstat command to list the ports opened for given process id.
        /// 1. Execute the netstat -ano | findstr /e process_id (matches all lines ending with process_id
        /// 2. Create an array by splitting the output by \r, \n, \t, ' ', ':'
        /// 3. Loop through the array values and if valuee==process_id get the necessary information
        /// </summary>
        /// <param name="processId"></param>
        /// <returns></returns>
        public static string GetOpenedPortsForProcessId(int processId)
        {
            try
            {
                StringBuilder portInfo = new StringBuilder(128);
                if (processId > 0)
                {
                    string netstatOutput = Helper.ExecuteCMDCommand("netstat -anop tcp | findstr /e " + processId);

                    if (netstatOutput.Contains(processId.ToString()))
                    {
                        Logger.Info("Ports for process ID " + processId + ":\r\n" + netstatOutput);
                        // split the output by \r\n
                        char[]   delimiter = new Char[] { ' ', '\t', '\r', ':' };
                        string[] parts     = netstatOutput.Split(delimiter, StringSplitOptions.RemoveEmptyEntries);

                        for (int i = 0; i < parts.Length; i++)
                        {
                            if (parts[i] == processId.ToString())
                            {
                                string status = String.Empty;
                                switch (parts[i - 1])
                                {
                                case "LISTENING": //english
                                case "ABH™REN":   //german
                                    status = Html.Notice("LISTENING");
                                    break;

                                case "ESTABLISHED": //english
                                case "HERGESTELLT": //german
                                    status = Html.B("ESTABLISHED");
                                    break;

                                default:
                                    status = parts[i - 1];
                                    break;
                                }
                                portInfo.Append(Html.br + "Port: " + parts[i - 4] + " " + status);
                            }
                        }
                    }
                }
                return(portInfo.ToString() + Html.br);
            }
            catch (Exception ex)
            {
                Logger.Warn(ex.ToString());
                return(null);
            }
        }
예제 #18
0
        static void GetShunraProductDetails(InstalledProgram p)
        {
            string currentVersion = RegistryWrapper.GetRegKey32(RegHive.LocalMachine, @"SOFTWARE\Shunra\Bootstrapper", "CurrentVersion");
            string buildVersion   = RegistryWrapper.GetRegKey32(RegHive.LocalMachine, @"SOFTWARE\Shunra\Bootstrapper", "BuildVersion");
            string installedPath  = RegistryWrapper.GetRegKey32(RegHive.LocalMachine, @"SOFTWARE\Shunra\Bootstrapper", "InstalledPath");

            productDetails = new StringBuilder();
            productDetails.Append(Html.B(p.DisplayName) + Helper.ConvertInstallDate(p.InstallDate) + Html.br);
            productDetails.Append("Version: " + currentVersion + Html.br);
            productDetails.Append("Build: " + buildVersion + Html.br);
            productDetails.Append("Location: " + installedPath + Html.br + Html.br);

            productDetails.Append("Services: " + Html.br);
            productDetails.Append("Shunra WatchDog Service: " + PCServicesCollectorHelper.GetServiceInfo("ShunraWatchDogService") + Html.br);
            productDetails.Append("Shunra Performance Counters Service: " + PCServicesCollectorHelper.GetServiceInfo("ShunraPerformanceCountersService") + Html.br);
        }
예제 #19
0
 public static string GetUsrEnvVariables()
 {
     try
     {
         var output = new StringBuilder();
         foreach (DictionaryEntry env in Environment.GetEnvironmentVariables(EnvironmentVariableTarget.User))
         {
             output.Append(Html.B(env.Key.ToString()) + "=" + env.Value.ToString() + Html.br);
         }
         return(output.ToString());
     }
     catch (Exception ex)
     {
         return(ex.ToString());
     }
 }
예제 #20
0
        internal static string FormatOutput(string commandOutput, string pid)
        {
            StringBuilder output = new StringBuilder();

            if (commandOutput.Length > 0)
            {
                string[] lines = commandOutput.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
                output.Append(lines.Length - 1 + " connections found" + Html.br);
                //output.Append("TYPE CONTROLLER_IP:PORT LG_IP:PORT" + Html.br);
                foreach (var line in lines)
                {
                    output.Append(line.Replace(pid, Html.br).Replace("TCP", Html.B("TCP")).Replace("ESTABLISHED", Html.Notice("ESTABLISHED")).Replace("HERGESTELLT", Html.Notice("HERGESTELLT")));
                }
            }

            return(output.ToString());
        }
예제 #21
0
 private string GetEnvironmentVariables()
 {
     try
     {
         string EnvironmentVariables = String.Empty;
         foreach (string envVar in environmentVarNames)
         {
             EnvironmentVariables += Html.B(envVar + " = ") + OSCollectorHelper.GetEnvVariable(envVar) + Html.br;
         }
         return(EnvironmentVariables);
     }
     catch (Exception ex)
     {
         Logger.Warn(ex.ToString());
         return("None");
     }
 }
예제 #22
0
        public static string GetROPortMappingOptions()
        {
            StringBuilder output  = new StringBuilder();
            string        keyPath = @"Software\Mercury Interactive\LoadRunner\Protocols\WPlus\SSL";

            output.Append(Html.br + Html.B("Network > Port Mapping > Options") + Html.br);
            output.Append(Html.IndentWithSpaces() + "Record-time auto SSL detection and configuration:" + Html.br);

            try
            {
                string EnableAutoSslDetect = CreateCheckBoxFromValue("Enable auto SSL detection", keyPath, "EnableAutoSslDetect");

                string DefaultSSLVersion = RegistryWrapper.GetValue(RegHive.CurrentUser, keyPath, "DefaultSSLVersion", "23");
                string DefaultSSLCiphers = RegistryWrapper.GetValue(RegHive.CurrentUser, keyPath, "DefaultSSLCiphers", "(Default OpenSsl Ciphers)");

                output.Append(Html.IndentWithSpaces(8) + "SSL Version: " + sslVersions[DefaultSSLVersion] + Html.br);
                output.Append(Html.IndentWithSpaces(8) + "SSL Ciphers: " + DefaultSSLCiphers + Html.br);

                keyPath = @"Software\Mercury Interactive\LoadRunner\Protocols\SOCKET";
                output.Append(Html.IndentWithSpaces() + "Record-time auto socket detection:" + Html.br);
                output.Append(CreateCheckBoxFromValue("Enable auto-detection of SOCKET based communication", keyPath, "EnableSocketAutoDetect", "1") + Html.br);

                string SendRecvTransitionThreshold = RegistryWrapper.GetValue(RegHive.CurrentUser, keyPath, "SendRecvTransitionThreshold", "4");
                string SendRecvBufferSizeThreshold = RegistryWrapper.GetValue(RegHive.CurrentUser, keyPath, "SendRecvBufferSizeThreshold", "2048");

                output.Append(Html.IndentWithSpaces(8) + "Send-Receive transition threshold: " + SendRecvTransitionThreshold + Html.br);
                output.Append(Html.IndentWithSpaces(8) + "Send-Receive buffer size threshold: " + SendRecvBufferSizeThreshold + Html.br);

                keyPath = @"Software\Mercury Interactive\LoadRunner\Protocols\WPlus\Analyzer";
                string WSPDebuggingLevelKey = RegistryWrapper.GetValue(RegHive.CurrentUser, keyPath, "WSPDebuggingLevel", "0");
                var    debuggingLevel       = new Hashtable()
                {
                    { "0", "None" }, { "5", "Standard (Default)" }, { "6", "Debug" }, { "9", "Advanced Debug" }
                };

                output.Append(Html.br + Html.IndentWithSpaces() + "Log level: " + debuggingLevel[WSPDebuggingLevelKey] + Html.br);
                return(output.ToString());
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
                return(ex.Message);
            }
        }
예제 #23
0
        public static string GetROScriptLevel()
        {
            StringBuilder output  = new StringBuilder();
            string        keyPath = @"Software\Mercury Interactive\Networking\Multi Settings\QTWeb\Recording";

            output.Append(Html.br + Html.B("General > Recording") + Html.br);
            output.Append(Html.IndentWithSpaces() + "HTTP/HTML Level" + Html.br);

            try
            {
                String AnalogMode          = RegistryWrapper.GetValue(RegHive.CurrentUser, keyPath, "Analog Mode", "0");
                String RecordDILFlag       = RegistryWrapper.GetValue(RegHive.CurrentUser, keyPath, "RecordDILFlag", "0");
                String RecordOutOfContext  = RegistryWrapper.GetValue(RegHive.CurrentUser, keyPath, "Record OutOfContext", "2");
                String ConcurrentGroupFlag = RegistryWrapper.GetValue(RegHive.CurrentUser, keyPath, "ConcurrentGroupFlag", "1");

                //check if we use HTML mode
                output.Append(Html.IndentWithSpaces() + Html.Radio((AnalogMode == "0"), 0) + "HTML-based script" + Html.br);

                if (AnalogMode == "0")
                {
                    output.Append(Html.IndentWithSpaces() + "Script type: " + Html.br);
                    output.Append(Html.Radio(RecordDILFlag == "0", 8) + "A script describing user actions (e.g. web_link, web_submit_form)" + Html.br);
                    output.Append(Html.Radio(RecordDILFlag == "1", 8) + "A script containing explicit URLs only (e.g. web_url, web_submit_data)" + Html.br);
                    output.Append(Html.IndentWithSpaces() + "Non HTML-generated elements (e.g. JavaScript, VBScript, ActiveX, Applets)" + Html.br);
                    output.Append(Html.Radio(RecordOutOfContext == "2", 8) + "Record within the current script step" + Html.br);
                    output.Append(Html.Radio(RecordOutOfContext == "1", 8) + "Do not record" + Html.br);
                    output.Append(Html.Radio(RecordOutOfContext == "0", 8) + "Record within the current script step" + Html.br);
                }

                output.Append(Html.Radio(Convert.ToInt16(AnalogMode) > 0) + "URL-based script" + Html.br);
                if (Convert.ToInt16(AnalogMode) > 0)
                {
                    output.Append(Html.CheckBox(ConcurrentGroupFlag == "1") + "Record within the current script step" + Html.br);
                    //If AnalogMode is 3 then the option is checked, if it is 2 it is unchecked
                    output.Append(Html.CheckBox(AnalogMode == "3") + "Use web_custom_request only" + Html.br);
                }
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
            }
            return(output.ToString());
        }
예제 #24
0
        public static string DepInfo()
        {
            switch (DepLevel)
            {
            case 0:
                return("DEP is disabled for all processes.\n(AlwaysOff)");

            case 1:
                return("DEP is " + Html.B(Html.Error("enabled")) + " for all processes.\n(AlwaysOn)");

            case 2:
                return("DEP is " + Html.B(Html.Error("enabled")) + " for only Windows system components and services. Default setting.\n(OptIn)");

            case 3:
                return("DEP is " + Html.B(Html.Error("enabled")) + " for all processes. Administrators can manually create a list of specific applications which do not have DEP applied.\n(OptOut)");

            default:
                return(Html.Warning("DEP status unknown\n"));
            }
        }
예제 #25
0
        public static string GetRODataFormat()
        {
            StringBuilder output = new StringBuilder();

            output.Append(Html.br + Html.B("Data Format Extention") + Html.br);

            try
            {
                string keyPath = @"Software\Mercury Interactive\Networking\Multi Settings\GlobalDfe\Recording\DFE";
                output.Append(CreateCheckBoxFromValue("Enable data format extention", keyPath, "Enabled", "False") + Html.br);
                output.Append(CreateCheckBoxFromValue("Verify formatted data", keyPath, "VerifyFormatedData", "False") + Html.br);
                string whatToFormat = RegistryWrapper.GetValue(RegHive.CurrentUser, keyPath, "WhatToFormat", "1");
                whatToFormat = whatToFormat == "1" ? "Code and snapshots" : "Snapshots";
                output.Append(Html.IndentWithSpaces() + "Format: " + whatToFormat + Html.br);
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
            }
            return(output.ToString());
        }
예제 #26
0
        internal string IsAgentInstalledInfo()
        {
            StringBuilder info = new StringBuilder(1024);

            // check if agent is installed as service/process
            if (isAgentInstalledAsProcess && isAgentInstalledAsService)
            {
                info.Append(Html.Error("The agent is installed both as a process and a service!" + Html.br));
            }
            else
            {
                if (isInstalled)
                {
                    info.Append("Yes, " + Html.B(installedAgentName) + " is installed. ");
                }
                else
                {
                    info.Append("The agent is not installed! ");
                }
            }
            return(info.ToString());
        }
            internal static string GetRdpRecOptions()
            {
                StringBuilder output = new StringBuilder();

                try
                {
                    output.Append(Html.B("Client Startup") + Html.br);
                    output.Append(Html.IndentWithSpaces() + "Run RDP client application: " + VugenProtocolsCollectorHelper.Rdp.GetRdpStartup() + Html.br);

                    output.Append(Html.B("Code Generation - Basic") + Html.br);
                    output.Append(Html.IndentWithSpaces() + "Script generation level: " + ini.GetSetting("CodeGeneration", "RDPScriptLevel") + Html.br);
                    output.Append(Html.CheckBox(ini.GetBoolSetting("CodeGeneration", "MouseMovement", false)) + "Generate mouse movement calls" + Html.br);
                    output.Append(Html.CheckBox(ini.GetBoolSetting("CodeGeneration", "RawMouse", false)) + "Generate raw mouse calls" + Html.br);
                    output.Append(Html.CheckBox(ini.GetBoolSetting("CodeGeneration", "RawKeyboard", false)) + "Generate raw keyboard calls" + Html.br);
                    output.Append(Html.CheckBox(ini.GetBoolSetting("CodeGeneration", "GenerateConnection", false)) + "Always generate connection name" + Html.br);
                    output.Append(Html.IndentWithSpaces() + "Automatic generation of synchronization points: " + GetGenerateAutoSyncPointsInfo() + Html.br);
                    output.Append(Html.IndentWithSpaces(8) + "Sync radius(pixels): " + ini.GetSetting("CodeGeneration", "AutoSyncDelta", "20") + Html.br);

                    //output.Append(Html.CheckBox(ini.GetBoolOption("SaveBitmaps", "BITMAPS", true)) + "Save snapshots");
                    output.Append(Html.br + Html.B("Code Generation - Adv") + Html.br);
                    output.Append(Html.IndentWithSpaces() + "Double-click timeout (msec): " + ini.GetSetting("CodeGeneration", "DblClickThreshold", "500") + Html.br);
                    output.Append(Html.IndentWithSpaces() + "Prefix for snapthos names: " + ini.GetSetting("CodeGeneration", "SnapshotsPrefix", "snapshot_") + Html.br);
                    output.Append(Html.IndentWithSpaces() + "Prefix for clipboard parameters: " + ini.GetSetting("CodeGeneration", "ClipboardParamsPrefix", "ClipboardDataParam_") + Html.br);
                    output.Append(Html.CheckBox(ini.GetBoolSetting("CodeGeneration", "ClipboardParamsCorrelation", true)) + "Correlate clipboard parameters" + Html.br);

                    output.Append(Html.br + Html.B("Code Generation - Agent") + Html.br);
                    output.Append(Html.CheckBox(ini.GetBoolSetting("CodeGeneration", "UseRdpAgent", false)) + "Use RDP agent" + Html.br);
                    output.Append(Html.CheckBox(ini.GetBoolSetting("CodeGeneration", "EnableRdpAgentLog", false)) + "Enable RDP agent log" + Html.br);
                    output.Append(Html.IndentWithSpaces(5) + "RDP agent log detail level: " + ini.GetSetting("CodeGeneration", "RdpAgentLogSeverityLevel", "Standard") + Html.br);
                    output.Append(Html.IndentWithSpaces(5) + "RDP agent log destination: " + ini.GetSetting("CodeGeneration", "RdpAgentLogDestination", "File") + Html.br);
                    output.Append(Html.IndentWithSpaces(5) + "RDP agent log folder: " + ini.GetSetting("CodeGeneration", "RdpAgentLogFileFolder", "") + Html.br);
                }
                catch (Exception ex)
                {
                    Logger.Error(ex.ToString());
                    return(ex.ToString());
                }
                return(output.ToString());
            }
예제 #28
0
        public static string GetROScriptGeneral()
        {
            string        keyPath = @"Software\Mercury Interactive\LoadRunner\Scripting\";
            StringBuilder output  = new StringBuilder();

            output.Append(Html.B("General > Script"));

            try
            {
                if (ProductDetection.Vugen.version > new Version(12, 5))
                {
                    string lang = RegistryWrapper.GetRegKey64(RegHive.CurrentUser, keyPath, "Language_QTWeb");
                    output.Append(Html.br + "Scripting language: " + lang);
                }
                keyPath = @"Software\Mercury Interactive\LoadRunner\Scripting\Options\General Options";

                output.Append(Html.br + CreateCheckBoxFromValue("Close all AUT processes when recording stops", keyPath, "CloseAUT", "False"));
                output.Append(Html.br + CreateCheckBoxFromValue("Generate fixed think time after end transaction", keyPath, "FixedThinkTime", "False"));
                output.Append(Html.br + CreateCheckBoxFromValue("Generate recorded events log", keyPath, "GenerateRecordingLog", "False"));
                output.Append(Html.br + CreateCheckBoxFromValue("Generate think time greater than threshold", keyPath, "ThinkTimeThreshold", "True"));
                output.Append(Html.br + CreateCheckBoxFromValue("Maximum number of lines in action file", keyPath, "NumberOfLinesPerFile", "False"));
                output.Append(Html.br + CreateCheckBoxFromValue("Track processes created as COM local servers", keyPath, "TrapLocalServer", "True"));
                //Below key is only available in LR 11.5 and later
                if (ProductDetection.Vugen.isNew)
                {
                    output.Append(Html.br + CreateCheckBoxFromValue("Use protected application recording", keyPath, "UseProtectedAppRecording", "False"));
                }
                if (ProductDetection.Vugen.version > new Version(11, 5))
                {
                    output.Append(Html.br + CreateCheckBoxFromValue("Warn me if application being recorded encounters an error", keyPath, "UseRecordingMalfunctiondiagnostics", "True"));
                }
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
                return(ex.Message);
            }
            return(output.ToString() + Html.br);
        }
예제 #29
0
        protected override void Collect()
        {
            var dh = new DataHolder("Operating System");

            dh.dataPairs.Add("Machine name", System.Environment.MachineName);
            dh.dataPairs.Add("Full name", OSCollectorHelper.GetOSFullNameFormatted());
            dh.dataPairs.Add("Root directory", OSCollectorHelper.GetOSRootDir());
            // If VuGen is not installed product version will be 0.0
            //if (ProductDetection.Vugen.version >= new Version(11, 04) && ProductDetection.Vugen.version <= new Version(12, 01))
            //  dh.dataPairs.Add("Is OS supported?", OSCollectorHelper.IsOSSupportedInfo());
            dh.dataPairs.Add("Language", OSCollectorHelper.language);
            dh.dataPairs.Add("Locale", OSCollectorHelper.GetOSLocaleInfo());
            dh.dataPairs.Add("Is OS Virtualized?", OSCollectorHelper.IsOSVirtualizedInfo());
            dh.dataPairs.Add("Is 3GB switch enabled?", OSCollectorHelper.Is3GBSwitchEnabled());
            dh.dataPairs.Add("Data Execution Prevention", OSCollectorHelper.DepInfo());
            dh.dataPairs.Add("User Account Control", OSCollectorHelper.UACInfo());
            dh.dataPairs.Add("Is user Admin?", Html.BoolToYesNo(OSCollectorHelper.IsUserInAdminGroup()));
            dh.dataPairs.Add("Is user connected remotely?", Html.BoolToYesNo(SystemInformation.TerminalServerSession));
            dh.dataPairs.Add("Is Windows firewall enabled?", OSCollectorHelper.IsWindowsFirewallEnabled());
            dh.dataPairs.Add("Is secondary logon enabled?", OSCollectorHelper.IsSecondaryLogonEnabledInfo());

            dataHolders.Add(dh);

            dh = new DataHolder("Environment information");
            dh.dataPairs.Add("System environment variables", Html.AddLinkToHiddenContent(OSCollectorHelper.GetEnvVariables()));
            dh.dataPairs.Add("User environment variables", Html.AddLinkToHiddenContent(OSCollectorHelper.GetUsrEnvVariables()));
            dh.dataPairs.Add("Kerberos configuration", OSCollectorHelper.GetKerberosConfiguration());
            var lsp = Html.B(OSCollectorHelper.GetNumberOfInstalledLSPs() + " entries found ") + Html.AddLinkToHiddenContent(OSCollectorHelper.GetInstalledLSPs());

            dh.dataPairs.Add("Layered Service Providers", lsp);
            dh.dataPairs.Add("AppInit_DLLs registry value", OSCollectorHelper.GetAppInitDLLsInfo());

            //LoadAppInit_DLLs registry is only availbale in Windows 7 and later
            if (Environment.OSVersion.Version >= new Version(6, 1))
            {
                dh.dataPairs.Add("LoadAppInit_DLLs registry value", OSCollectorHelper.GetLoadAppInitDLLsInfo());
            }
            dataHolders.Add(dh);
        }
예제 #30
0
        public static string GetNetworkCardsInfo()
        {
            StringBuilder output = new StringBuilder(128);

            // split the output by \r\n
            string[] rows        = OSCollectorHelper.SystemInfo.Split(new Char[] { '\r', '\n', '\t' }, StringSplitOptions.RemoveEmptyEntries);
            int      startingRow = 0;
            int      i           = 0;

            foreach (string row in rows)
            {
                if (row.Contains("Network Card"))
                {
                    startingRow = i + 1;
                    output.Append(row.Replace("Network Card(s): ", "") + " ");
                    break;
                }
                i++;
            }

            StringBuilder updates = new StringBuilder();

            if (startingRow != 0)
            {
                for (i = startingRow; i < rows.Length; i++)
                {
                    if (rows[i].Replace("                           ", "").StartsWith("["))
                    {
                        updates.Append(Html.B(rows[i]) + Html.br);
                    }
                    else
                    {
                        updates.Append("&nbsp;&nbsp;&nbsp;&nbsp;" + rows[i] + Html.br);
                    }
                }
                output.Append(Html.AddLinkToHiddenContent(updates.ToString()));
            }
            return(output.ToString());
        }