示例#1
0
 public System.Collections.Generic.List <PropertiesMessage> Scan_EATON(string startIp, string endIp)
 {
     System.Collections.Generic.List <PropertiesMessage> list  = new System.Collections.Generic.List <PropertiesMessage>();
     System.Collections.Generic.List <string>            list2 = this.countIp(startIp, endIp);
     if (list2 == null || list2.Count < 1)
     {
         return(null);
     }
     this.total = list2.Count;
     System.Collections.Generic.List <SnmpConfiger>      snmpConfigs          = this.createSnmpConfig(list2);
     System.Collections.Generic.List <PropertiesMessage> eatonPDUProperties   = new DefaultSnmpExecutors(snmpConfigs).GetEatonPDUProperties();
     System.Collections.Generic.List <PropertiesMessage> eatonPDUProperties_M = new DefaultSnmpExecutors(snmpConfigs).GetEatonPDUProperties_M2();
     if (eatonPDUProperties != null)
     {
         foreach (PropertiesMessage current in eatonPDUProperties)
         {
             list.Add(current);
         }
     }
     if (eatonPDUProperties_M != null)
     {
         foreach (PropertiesMessage current2 in eatonPDUProperties_M)
         {
             list.Add(current2);
         }
     }
     return(list);
 }
示例#2
0
        public System.Collections.Generic.List <ThresholdMessage> GetMonitorThresholds(System.Collections.Generic.List <SnmpConfiger> snmpConfigs)
        {
            DefaultSnmpExecutors defaultSnmpExecutors = new DefaultSnmpExecutors(snmpConfigs);

            System.Collections.Generic.List <ThresholdMessage> thresholds = defaultSnmpExecutors.GetThresholds();
            this.retryConfigs = defaultSnmpExecutors.getRetryList();
            return(thresholds);
        }
示例#3
0
        public System.Collections.Generic.List <SnmpConfiger> SetDeviceVoltages(System.Collections.Generic.List <SnmpConfiger> snmpConfigs, float voltage)
        {
            System.Collections.Generic.List <SnmpConfiger> list = new System.Collections.Generic.List <SnmpConfiger>();
            foreach (SnmpConfiger current in snmpConfigs)
            {
                if (current.DevModel.Equals("EC1000"))
                {
                    list.Add(current);
                }
            }
            DefaultSnmpExecutors defaultSnmpExecutors = new DefaultSnmpExecutors(list);

            return(defaultSnmpExecutors.UpdateDeviceVoltages(voltage));
        }
示例#4
0
        public DevPortGroupAPI(System.Collections.Generic.List <DevSnmpConfig> devcfgs)
        {
            this.devsnmpconfigs = devcfgs;
            DevAccessCfg instance = DevAccessCfg.GetInstance();

            foreach (DevSnmpConfig current in devcfgs)
            {
                DevModelConfig deviceModelConfig = instance.getDeviceModelConfig(current.modelName, current.fmwareVer);
                SnmpConfiger   snmpConfiger      = new SnmpConfiger(instance.getSnmpConfig(current), deviceModelConfig, current.devMac, current.devID);
                snmpConfiger.GroupOutlets = current.groupOutlets;
                this.snmpConfigs.Add(snmpConfiger);
            }
            this.se = new DefaultSnmpExecutors(this.snmpConfigs);
        }
示例#5
0
        public void SetTrapReceiver(System.Collections.Generic.List <DevSnmpConfig> configs, Sys_Para pSys)
        {
            DevAccessCfg instance = DevAccessCfg.GetInstance();

            System.Collections.Generic.List <SnmpConfiger> list = new System.Collections.Generic.List <SnmpConfiger>();
            foreach (DevSnmpConfig current in configs)
            {
                DevModelConfig deviceModelConfig = instance.getDeviceModelConfig(current.modelName, current.fmwareVer);
                SnmpConfiger   item = new SnmpConfiger(instance.getSnmpConfig(current), deviceModelConfig, current.devMac, current.devID);
                list.Add(item);
            }
            DefaultSnmpExecutors defaultSnmpExecutors = new DefaultSnmpExecutors(list);

            defaultSnmpExecutors.UpdateTrapReceiver(pSys, TrapEnabled.Yes);
        }
示例#6
0
        public System.Collections.Generic.List <ThresholdMessage> GetMonitorThresholds(System.Collections.Generic.List <DevSnmpConfig> configs)
        {
            DevAccessCfg instance = DevAccessCfg.GetInstance();

            System.Collections.Generic.List <SnmpConfiger> list = new System.Collections.Generic.List <SnmpConfiger>();
            foreach (DevSnmpConfig current in configs)
            {
                DevModelConfig deviceModelConfig = instance.getDeviceModelConfig(current.modelName, current.fmwareVer);
                SnmpConfiger   item = new SnmpConfiger(instance.getSnmpConfig(current), deviceModelConfig, current.devMac, current.devID);
                list.Add(item);
            }
            DefaultSnmpExecutors defaultSnmpExecutors = new DefaultSnmpExecutors(list);

            System.Collections.Generic.List <ThresholdMessage> thresholds = defaultSnmpExecutors.GetThresholds();
            this.retryConfigs = defaultSnmpExecutors.getRetryList();
            return(thresholds);
        }
示例#7
0
        public string[] RestoreThresholds2Device(System.Collections.Generic.List <SnmpConfiger> snmpConfigs)
        {
            DefaultSnmpExecutors defaultSnmpExecutors = new DefaultSnmpExecutors(snmpConfigs);

            return(defaultSnmpExecutors.RestoreThresholds2Device());
        }
示例#8
0
        public void SetTrapReceiver(System.Collections.Generic.List <SnmpConfiger> snmpConfigs, Sys_Para pSys)
        {
            DefaultSnmpExecutors defaultSnmpExecutors = new DefaultSnmpExecutors(snmpConfigs);

            defaultSnmpExecutors.UpdateTrapReceiver(pSys, TrapEnabled.Yes);
        }
示例#9
0
 public System.Collections.Generic.List <PropertiesMessage> Scan_ATEN(string startIp, string endIp)
 {
     System.Collections.Generic.List <string> list = this.countIp(startIp, endIp);
     if (list == null || list.Count < 1)
     {
         return(null);
     }
     this.total = list.Count;
     System.Collections.Generic.List <SnmpConfiger>      snmpConfigs     = this.createSnmpConfig(list);
     System.Collections.Generic.List <PropertiesMessage> properties_ATEN = new DefaultSnmpExecutors(snmpConfigs).GetProperties_ATEN();
     System.Collections.Generic.List <PropertiesMessage> list2           = new System.Collections.Generic.List <PropertiesMessage>();
     System.Collections.Generic.List <DevModelConfig>    list3           = new System.Collections.Generic.List <DevModelConfig>();
     if (properties_ATEN != null && properties_ATEN.Count > 0)
     {
         DBConn connection = DBConnPool.getConnection();
         foreach (PropertiesMessage current in properties_ATEN)
         {
             if (!current.ModelName.Equals("Null"))
             {
                 if (!string.IsNullOrEmpty(current.AutoBasicInfo) && !string.IsNullOrEmpty(current.AutoRatingInfo))
                 {
                     try
                     {
                         int num = this.cfg.updateAutoModelList2Database(connection, current.ModelName, current.FirwWareVersion, current.AutoBasicInfo, current.AutoRatingInfo);
                         if (num > 0)
                         {
                             list3.Add(new DevModelConfig(current.ModelName)
                             {
                                 modelName      = current.ModelName,
                                 firmwareVer    = current.FirwWareVersion,
                                 autoBasicInfo  = current.AutoBasicInfo,
                                 autoRatingInfo = current.AutoRatingInfo
                             });
                         }
                         else
                         {
                             if (num != 0 && num < 0)
                             {
                                 DebugCenter.GetInstance().appendToFile(string.Concat(new string[]
                                 {
                                     "Failed to update auto-detect info: ",
                                     current.ModelName,
                                     ", ",
                                     current.AutoBasicInfo,
                                     current.AutoRatingInfo
                                 }));
                                 continue;
                             }
                         }
                     }
                     catch (System.Exception)
                     {
                         DebugCenter.GetInstance().appendToFile(string.Concat(new string[]
                         {
                             "Exception when parsing auto-detect info: ",
                             current.ModelName,
                             ", ",
                             current.AutoBasicInfo,
                             current.AutoRatingInfo
                         }));
                         continue;
                     }
                 }
                 list2.Add(current);
             }
         }
         try
         {
             connection.Close();
         }
         catch
         {
         }
         if (DevDiscoverAPI._cbOnAutoModePost != null && list3.Count > 0)
         {
             DevDiscoverAPI._cbOnAutoModePost(list3);
         }
     }
     return(list2);
 }