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));
                }
            }
예제 #2
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");
     }
 }
예제 #3
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());
        }
예제 #4
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());
     }
 }
예제 #5
0
 internal static string GetClassPath()
 {
     return(Html.B("CLASSPATH") + " = " + OSCollectorHelper.GetEnvVariable("CLASSPATH"));
 }