Esempio n. 1
0
        protected override void Collect()
        {
            string tabName = "Software Information";

            AddDataPair(tabName, "Default browser", OSCollectorHelper.GetDefaultBrowser());
            // Internet Explorer
            AddDataPair(tabName, "Internet Explorer version", OSCollectorHelper.GetIEVersion());
            AddDataPair(tabName, "Internet Explorer Extensions"
                        , Html.AddLinkToHiddenContent(DetectOtherSoftware.GetIEExtensions()));
            // Google Chrome
            AddDataPair(tabName, "Is Google Chrome installed?", DetectOtherSoftware.GetGoogleChromeInfo());
            // Mozilla Firefox
            AddDataPair(tabName, "Is Mozilla Firefox installed?", DetectOtherSoftware.GetFirefoxInfo());
            AddDataPair(tabName, "Is anti-virus software detected?", DetectSecuritySoftware.GetAntiVirusProgramsInstalled());
            AddDataPair(tabName, "Is firewall software detected?", DetectSecuritySoftware.GetFirewallProgramsInstalled());

            // Add the list of Windows Add/Remove Programs only if the menu is selected
            if (FormArguments.menuInstalledPrograms || FormArguments.details >= 3)
            {
                var listOfPrograms = InstalledProgramsHelper.ToList();
                int count          = InstalledProgramsHelper.installedProgramsList.Count;
                AddDataPair("Windows Add/Remove Programs", "Installed programs", count + " products found " + listOfPrograms);
            }
            if (FormArguments.menuWindowsUpdates || FormArguments.details >= 3)
            {
                AddDataPair("Windows Add/Remove Programs", "Installed Windows updates", InstalledProgramsHelper.GetWindowsUpdatesInfo());
            }
        }
            public static string GetFlexInfo()
            {
                try
                {
                    StringBuilder output = new StringBuilder();

                    var fileInfo = Helper.GetFileInfo(Path.Combine(ProductDetection.Vugen.InstallLocation, @"jars\ConvertExternalizableObject.jar"));
                    if (fileInfo != null)
                    {
                        output.Append("ConvertExternalizableObject.jar exists, " + fileInfo["Size"].ToString() + " bytes, last modified on: " + fileInfo["ModifiedOn"].ToString() + Html.br);
                    }
                    else
                    {
                        output.Append(Html.Error("ConvertExternalizableObject.jar does not exist in " + ProductDetection.Vugen.InstallLocation + @"\jars folder") + Html.br);
                    }


                    string env = OSCollectorHelper.GetEnvVariable("HP_FLEX_JAVA_LOG_FILE");

                    output.Append("Environment variable HP_FLEX_JAVA_LOG_FILE = " + env);

                    return(output.ToString());
                }
                catch (Exception ex)
                {
                    Logger.Error(ex.ToString());
                    return(Html.Error(ex.Message));
                }
            }
Esempio n. 3
0
        internal static string IsOSSupportedInfo()
        {
            try
            {
                var name = OSCollectorHelper.GetOSFullNameFormatted();
                if (ProductDetection.Vugen.IsInstalled)
                {
                    Version osVersion = Environment.OSVersion.Version;
                    string  osString  = String.Format("{0}.{1}.{2}", osVersion.Major.ToString(), osVersion.Minor.ToString(), osVersion.Build.ToString());
                    OS      hostOS    = new OS(osString, spInt, bitsInt);
                    Logger.Debug(String.Format("hostOs: OSString:{0}, SP:{1}, Bits:{2}", osString, spInt, bitsInt));
                    // Get supported OSes for current product version
                    List <OS> supportedOsList = OS.GetSupportedOSForProductVersion(ProductDetection.Vugen.ProductVersion);

                    OS supportedOs = OS.FindSupportedOs(hostOS, supportedOsList);

                    if (supportedOs != null)
                    {
                        return(supportedOs.recommended ? Html.cYes : Html.Yes);
                    }
                    else
                    {
                        return(Html.cNo);// "Unknown product version (You might be using an old LRDetect version).";
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.Error(ex.ToString());
                return(ex.Message);
            }
            return(Html.cNo);
        }
Esempio n. 4
0
 protected override void Collect()
 {
     Process[] processes = OSCollectorHelper.GetRunningProcesses();
     foreach (var p in processes)
     {
         AddStringsToDataCells(new String[3]
         {
             p.ProcessName
             , (p.WorkingSet64 / 1024).ToString() + " Kb"
             , p.Id.ToString()
         });
     }
 }
Esempio n. 5
0
 /// <summary>
 /// Check if the virtual memory available to a process is > 2048
 /// </summary>
 /// <returns></returns>
 public static string Is3GBSwitchEnabled()
 {
     if (is64BitOperatingSystem)
     {
         return("Not applicable to 64-bit Operating Systems");
     }
     try
     {
         int virtualMemory = OSCollectorHelper.GetTotalMemory("Virtual");
         return((virtualMemory > 2048) ? "Yes" : "No");
     }
     catch (Exception ex)
     {
         Logger.Info(ex.ToString());
         return(Html.ErrorMsg());
     }
 }
Esempio n. 6
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");
     }
 }
Esempio n. 7
0
        protected override void Collect()
        {
            var dh = new DataHolder("Hardware Information");

            dh.dataPairs.Add("CPU", OSCollectorHelper.GetProcessorNameString());
            dh.dataPairs.Add("Processor Count", Environment.ProcessorCount.ToString());
            dh.dataPairs.Add("Total Memory", OSCollectorHelper.GetMemoryInfo());
            dh.dataPairs.Add("Hard Drives", OSCollectorHelper.GetHardDrivesInformation());
            dh.dataPairs.Add("Monitor information", OSCollectorHelper.GetMonitorsInfo());
            //IPCONFIG /ALL
            if (FormArguments.network || FormArguments.details >= 3)
            {
                dh.dataPairs.Add("Network cards & IPs", OSCollectorHelper.GetNetworkCardsInfo());
                dh.dataPairs.Add("Output of 'ipconfig /all' command", Html.AddLinkToHiddenContent(Html.Pre(OSCollectorHelper.IpConfig())));
            }

            dataHolders.Add(dh);
        }
Esempio n. 8
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);
        }
Esempio n. 9
0
        public static string GetKerberosConfiguration()
        {
            StringBuilder krb5Content = new StringBuilder();
            // Get the KRB5_CONFIG environment variable
            string krb5File = OSCollectorHelper.GetEnvVariable("KRB5_CONFIG");

            // If KRB5_CONFIG is not set
            if (krb5File.Contains("Not set"))
            {
                // Sometimes KRB5_CONFIG is not set because the krb5.ini is placed in C:\Windows
                Logger.Info("No KRB5_CONFIG eng. variable found. Searching for the file in C:\\Windows");
                if (File.Exists(@"C:\Windows\krb5.ini"))
                {
                    krb5File = @"C:\Windows\krb5.ini";
                }
                else
                {
                    return("Not detected");
                }
            }
            else
            {
                krb5Content.Append(Html.B("KRB5_CONFIG = ") + krb5File + Html.br);
            }
            // Check if KRB5_TRACE exists and if it does add it's value
            var krb5trace = OSCollectorHelper.GetEnvVariable("KRB5_TRACE");

            if (!krb5trace.Contains("Not set"))
            {
                krb5Content.Append(Html.B("KRB5_TRACE = ") + krb5trace + Html.br + Html.br);
            }

            // Get the content of krb5.ini
            Logger.Info("Getting the content from " + krb5File);
            krb5Content.Append("krb5.ini " + Html.AddLinkToHiddenContent(IniParser.ToHtml(krb5File)));

            return(krb5Content.ToString());
        }
Esempio n. 10
0
 internal static string GetJavaEnvs()
 {
     try
     {
         StringBuilder sb = new StringBuilder();
         // display only those env. variables that are present
         string[] envVarsNames = { "JAVA_HOME", "JAVA_OPTIONS", "_JAVA_OPTIONS", "JAVA_TOOLS_OPTIONS" };
         foreach (string envVarName in envVarsNames)
         {
             string envVar = OSCollectorHelper.GetEnvVariable(envVarName);
             if (!envVar.Contains("Not set!"))
             {
                 sb.Append(Html.B(envVarName) + " = " + envVar + Html.br);
             }
         }
         return(sb.ToString());
     }
     catch (Exception ex)
     {
         Logger.Error(ex.ToString());
         return(Html.ErrorMsg());
     }
 }
Esempio n. 11
0
 internal static string GetClassPath()
 {
     return(Html.B("CLASSPATH") + " = " + OSCollectorHelper.GetEnvVariable("CLASSPATH"));
 }