Esempio n. 1
0
        // Token: 0x060006D2 RID: 1746 RVA: 0x0002B708 File Offset: 0x00029908
        public static void EnsureHistoryTables()
        {
            DateTime  value = DateTime.FromOADate(SettingsDAL.GetCurrent <double>("SWNetPerfMon-Settings-Last Archive", new DateTime(1900, 1, 1).ToOADate()));
            int       days  = DateTime.UtcNow.Subtract(value).Days;
            DataTable dataTable;

            using (SqlCommand textCommand = SqlHelper.GetTextCommand("SELECT ObjectName, ObjectType FROM [dbo].[HistoryTableDDL] WHERE NumberOfDaysAhead < @lastMaintDays"))
            {
                textCommand.Parameters.AddWithValue("lastMaintDays", days);
                dataTable = SqlHelper.ExecuteDataTable(textCommand);
            }
            HistoryTableDdlDAL.log.InfoFormat("Days since last maintenance: {0}; Creating {1} tables", days, dataTable.Rows.Count);
            foreach (DataRow row in dataTable.Rows.Cast <DataRow>())
            {
                string text  = row.Field(0);
                string text2 = row.Field(1);
                HistoryTableDdlDAL.log.DebugFormat("Creating table {0}-{1}", text, text2);
                using (SqlCommand textCommand2 = SqlHelper.GetTextCommand("Exec [dbo].[dbm_SlidePartitionedView] @objectName, @objectType, @dropOldTables"))
                {
                    textCommand2.Parameters.AddWithValue("objectName", text);
                    textCommand2.Parameters.AddWithValue("objectType", text2);
                    textCommand2.Parameters.AddWithValue("dropOldTables", false);
                    SqlHelper.ExecuteNonQuery(textCommand2);
                }
            }
        }
 public BackgroundInventory(int parallelTasksCount, Dictionary <string, object> plugins)
 {
     if (plugins == null)
     {
         throw new ArgumentNullException(nameof(plugins));
     }
     this.scheduler = new QueuedTaskScheduler <SolarWinds.Orion.Core.BusinessLayer.BackgroundInventory.BackgroundInventory.InventoryTask>(new QueuedTaskScheduler <SolarWinds.Orion.Core.BusinessLayer.BackgroundInventory.BackgroundInventory.InventoryTask> .TaskProcessingRoutine(this.DoInventory), parallelTasksCount);
     this.scheduler.TaskProcessingFinished += new EventHandler(this.scheduler_TaskProcessingFinished);
     this.snmpGlobals = new SnmpGlobalSettings();
     this.snmpGlobals.set_MaxReplies(SettingsDAL.GetCurrentInt("SWNetPerfMon-Settings-SNMP MaxReps", 5));
     this.snmpGlobals.set_RequestTimeout(SettingsDAL.GetCurrentInt("SWNetPerfMon-Settings-SNMP Timeout", 2500));
     this.snmpGlobals.set_RequestRetries(SettingsDAL.GetCurrentInt("SWNetPerfMon-Settings-SNMP Retries", 2));
     this.snmpGlobals.set_HsrpEnabled((bool)SettingsDAL.GetCurrent <bool>("SWNetPerfMon-Settings-SNMP HSRPEnabled", (M0)1));
     this.wmiGlobals = new WmiGlobalSettings();
     this.wmiGlobals.set_UserImpersonationLevel((ImpersonationLevel)SettingsDAL.GetCurrent <ImpersonationLevel>("SWNetPerfMon-Settings-Wmi UserImpersonationLevel", (M0)0));
     this.wmiGlobals.set_ConnectionRationMode((WmiConnectionRationMode)SettingsDAL.GetCurrent <WmiConnectionRationMode>("SWNetPerfMon-Settings-Wmi ConnectionRationMode", (M0)1));
     this.wmiGlobals.set_MaxRationedConnections(SettingsDAL.GetCurrentInt("SWNetPerfMon-Settings-Wmi MaxRationedConnections", 0));
     this.wmiGlobals.set_KillProcessExcessiveError((bool)SettingsDAL.GetCurrent <bool>("SWNetPerfMon-Settings-Wmi KillProcessExcessiveError", (M0)1));
     this.wmiGlobals.set_ExcessiveErrorThreshhold(SettingsDAL.GetCurrentInt("SWNetPerfMon-Settings-Wmi ExcessiveErrorThreshhold", 50));
     this.wmiGlobals.set_WmiRetries(SettingsDAL.GetCurrentInt("SWNetPerfMon-Settings-WMI Retries", 0));
     this.wmiGlobals.set_WmiRetryInterval(SettingsDAL.GetCurrentInt("SWNetPerfMon-Settings-WMI Retry Interval", 0));
     this.wmiGlobals.set_WmiAutoCorrectRDNSInconsistency(Convert.ToBoolean(SettingsDAL.GetCurrentInt("SWNetPerfMon-Settings-WMI Auto Correct Reverse DNS", 0)));
     this.wmiGlobals.set_WmiDefaultRootNamespaceOverrideIndex(SettingsDAL.GetCurrentInt("SWNetPerfMon-Settings-WMI Default Root Namespace Override Index", 0));
     this.inventories = plugins;
 }
 // Token: 0x060008D8 RID: 2264 RVA: 0x0003F7E4 File Offset: 0x0003D9E4
 public BackgroundInventory(int parallelTasksCount, Dictionary <string, object> plugins)
 {
     if (plugins == null)
     {
         throw new ArgumentNullException("plugins");
     }
     this.scheduler = new QueuedTaskScheduler <BackgroundInventory.InventoryTask>(new QueuedTaskScheduler <BackgroundInventory.InventoryTask> .TaskProcessingRoutine(this.DoInventory), parallelTasksCount);
     this.scheduler.TaskProcessingFinished += this.scheduler_TaskProcessingFinished;
     this.snmpGlobals                = new SnmpGlobalSettings();
     this.snmpGlobals.MaxReplies     = SettingsDAL.GetCurrentInt("SWNetPerfMon-Settings-SNMP MaxReps", 5);
     this.snmpGlobals.RequestTimeout = SettingsDAL.GetCurrentInt("SWNetPerfMon-Settings-SNMP Timeout", 2500);
     this.snmpGlobals.RequestRetries = SettingsDAL.GetCurrentInt("SWNetPerfMon-Settings-SNMP Retries", 2);
     this.snmpGlobals.HsrpEnabled    = SettingsDAL.GetCurrent <bool>("SWNetPerfMon-Settings-SNMP HSRPEnabled", true);
     this.wmiGlobals = new WmiGlobalSettings();
     this.wmiGlobals.UserImpersonationLevel    = SettingsDAL.GetCurrent <ImpersonationLevel>("SWNetPerfMon-Settings-Wmi UserImpersonationLevel", ImpersonationLevel.Default);
     this.wmiGlobals.ConnectionRationMode      = SettingsDAL.GetCurrent <WmiConnectionRationMode>("SWNetPerfMon-Settings-Wmi ConnectionRationMode", 1);
     this.wmiGlobals.MaxRationedConnections    = SettingsDAL.GetCurrentInt("SWNetPerfMon-Settings-Wmi MaxRationedConnections", 0);
     this.wmiGlobals.KillProcessExcessiveError = SettingsDAL.GetCurrent <bool>("SWNetPerfMon-Settings-Wmi KillProcessExcessiveError", true);
     this.wmiGlobals.ExcessiveErrorThreshhold  = SettingsDAL.GetCurrentInt("SWNetPerfMon-Settings-Wmi ExcessiveErrorThreshhold", 50);
     this.wmiGlobals.WmiRetries       = SettingsDAL.GetCurrentInt("SWNetPerfMon-Settings-WMI Retries", 0);
     this.wmiGlobals.WmiRetryInterval = SettingsDAL.GetCurrentInt("SWNetPerfMon-Settings-WMI Retry Interval", 0);
     this.wmiGlobals.WmiAutoCorrectRDNSInconsistency      = Convert.ToBoolean(SettingsDAL.GetCurrentInt("SWNetPerfMon-Settings-WMI Auto Correct Reverse DNS", 0));
     this.wmiGlobals.WmiDefaultRootNamespaceOverrideIndex = SettingsDAL.GetCurrentInt("SWNetPerfMon-Settings-WMI Default Root Namespace Override Index", 0);
     this.inventories = plugins;
 }
Esempio n. 4
0
 public BackgroundInventoryManager(int parallelTasksCount)
 {
     this.scheduler = new QueuedTaskScheduler <BackgroundInventoryManager.InventoryTask>(new QueuedTaskScheduler <BackgroundInventoryManager.InventoryTask> .TaskProcessingRoutine(this.DoInventory), parallelTasksCount);
     this.scheduler.TaskProcessingFinished += new EventHandler(this.scheduler_TaskProcessingFinished);
     this.globals = new SnmpGlobalSettings();
     this.globals.set_MaxReplies(SettingsDAL.GetCurrentInt("SWNetPerfMon-Settings-SNMP MaxReps", 5));
     this.globals.set_RequestTimeout(SettingsDAL.GetCurrentInt("SWNetPerfMon-Settings-SNMP Timeout", 2500));
     this.globals.set_RequestRetries(SettingsDAL.GetCurrentInt("SWNetPerfMon-Settings-SNMP Retries", 2));
     this.globals.set_HsrpEnabled((bool)SettingsDAL.GetCurrent <bool>("SWNetPerfMon-Settings-SNMP HSRPEnabled", (M0)1));
     this.inventories = new Dictionary <string, BackgroundInventoryManager.DoInventoryDelegate>((IEqualityComparer <string>)StringComparer.OrdinalIgnoreCase);
     this.inventories.Add("Cpu", new BackgroundInventoryManager.DoInventoryDelegate(this.DoCpuInventory));
     this.inventories.Add("Memory", new BackgroundInventoryManager.DoInventoryDelegate(this.DoMemoryInventory));
 }
Esempio n. 5
0
 public void Start()
 {
     try
     {
         this.AuditingTrailsEnabled = (bool)SettingsDAL.GetCurrent <bool>("SWNetPerfMon-AuditingTrails", (M0)1);
     }
     catch (Exception ex)
     {
         AuditingNotificationSubscriber.log.FatalFormat("Auditing setting error - will be forciby enabled. {0}", (object)ex);
         this.AuditingTrailsEnabled = true;
     }
     this.checkAuditingSetting = true;
     this.auditingPlugins.Initialize();
     Scheduler.get_Instance().Add(new ScheduledTask("AuditingIndications", new TimerCallback(this.Subscribe), (object)null, TimeSpan.FromSeconds(1.0), TimeSpan.FromMinutes(1.0)), true);
 }