Exemplo n.º 1
0
 public System.Collections.Generic.Dictionary <int, System.Collections.Generic.List <int> > TurnOffDeviceOutlets()
 {
     this.devMap.Clear();
     foreach (DevSnmpConfig current in this.devsnmpconfigs)
     {
         this.cfg     = DevAccessCfg.GetInstance();
         this.snmpCfg = current;
         this.sc      = this.cfg.getSnmpConfig(this.snmpCfg);
         this.mc      = this.cfg.getDeviceModelConfig(this.snmpCfg.modelName, this.snmpCfg.fmwareVer);
         if (this.mc.switchable == 2)
         {
             this.se = new DefaultSnmpExecutor(new SnmpConfiger(this.sc, this.mc));
             bool flag = this.se.TurnOffOutlets();
             if (flag)
             {
                 for (int i = 1; i <= this.mc.portNum; i++)
                 {
                     current.groupOutlets.Add(i);
                 }
                 this.devMap.Add(current.devID, current.groupOutlets);
             }
         }
     }
     return(this.devMap);
 }
Exemplo n.º 2
0
 public DevAccessAPI(DevSnmpConfig snmpSettings)
 {
     this.cfg     = DevAccessCfg.GetInstance();
     this.snmpCfg = snmpSettings;
     this.sc      = this.cfg.getSnmpConfig(this.snmpCfg);
     this.mc      = this.cfg.getDeviceModelConfig(this.snmpCfg.modelName, this.snmpCfg.fmwareVer);
     this.se      = new DefaultSnmpExecutor(new SnmpConfiger(this.sc, this.mc));
 }
Exemplo n.º 3
0
 public static int GetSensorCount(string str_model, string str_fwversion)
 {
     try
     {
         return(DevAccessCfg.GetInstance().getDeviceModelConfig(str_model, str_fwversion).sensorNum);
     }
     catch
     {
     }
     return(-1);
 }
Exemplo n.º 4
0
        public System.Collections.Generic.List <ValueMessage> GetMonitorValues(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);
            }
            return(new DefaultSnmpExecutors(list).GetVaules());
        }
Exemplo n.º 5
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);
        }
Exemplo n.º 6
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);
        }
Exemplo n.º 7
0
        public System.Collections.Generic.List <ThresholdMessage> GetThresholdsEatonPDU_M2(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)
            {
                DevAccessAPI   devAccessAPI      = new DevAccessAPI(current);
                DevRealConfig  eatonPDUNumber_M  = devAccessAPI.GetEatonPDUNumber_M2();
                DevModelConfig deviceModelConfig = instance.getDeviceModelConfig(current.modelName, current.fmwareVer);
                SnmpConfiger   item = new SnmpConfiger(instance.getSnmpConfig(current), deviceModelConfig, current.devMac, current.devID, eatonPDUNumber_M);
                list.Add(item);
            }
            return(new DefaultSnmpExecutors(list).GetThresholdsEatonPDU_M2());
        }
Exemplo n.º 8
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);
        }
Exemplo n.º 9
0
 public DevDiscoverAPI(DevSnmpConfig snmpSettings)
 {
     this.cfg     = DevAccessCfg.GetInstance();
     this.snmpCfg = snmpSettings;
     this.sc      = this.cfg.getSnmpConfig(this.snmpCfg);
 }