예제 #1
0
        private IEnumerable <Result> ConvertToResult(IDrobo drobo)
        {
            List <Result> results = new List <Result>();

            foreach (var drive in drobo.Drives)
            {
                results.Add(ResultForDrive(drive));
            }


            results.Add(new Result("Free capacity protected", drobo.FreeCapacityProtected)
            {
                Unit       = UnitTypes.BytesDisk,
                Mode       = SensorModes.Absolute,
                VolumeSize = SensorSpeedSize.GigaByte,
                Data       = DataType.Percent,
                Maximum    = drobo.TotalCapacityProtected
            });
            results.Add(new Result("Total Capacity", drobo.UsedCapacityProtected)
            {
                Unit       = UnitTypes.BytesDisk,
                VolumeSize = SensorSpeedSize.GigaByte,
            });
            return(results);
        }
예제 #2
0
        private IEnumerable <Result> ConvertToResult(IDrobo drobo)
        {
            List <Result> results = new List <Result>();


            double usedPercent = 100 - Math.Round((drobo.FreeCapacityProtected / drobo.TotalCapacityProtected) * 100, 2);

            results.Add(new Result("Used protected space", usedPercent)
            {
                Unit            = UnitTypes.Percent,
                Mode            = SensorModes.Absolute,
                LimitMaxWarning = 75,
                LimitWarningMsg = "You have less than 25% protected space available",
                LimitMaxError   = 90,
                LimitErrorMsg   = "You are nearly out of protected space",
                LimitMode       = true,
                Float           = true
            });



            foreach (var drive in drobo.Drives)
            {
                results.AddRange(ResultForDrive(drive));
            }

            Result freeProtectedSpace = new Result("Free protected space", drobo.FreeCapacityProtected)
            {
                Unit =
                    UnitTypes.BytesDisk,
                VolumeSize =
                    SensorSpeedSize
                    .MegaByte,
            };

            results.Add(freeProtectedSpace);

            Result totalCapacity = new Result("Total Capacity", drobo.TotalCapacityProtected)
            {
                Unit =
                    UnitTypes.BytesDisk,
                VolumeSize =
                    SensorSpeedSize
                    .MegaByte,
            };

            results.Add(totalCapacity);
            return(results);
        }
예제 #3
0
 private void Connection_DataRecieved(IDrobo drobo)
 {
     Console.WriteLine("Drobo data received");
     if (drobo is DroboError)
     {
         Console.WriteLine("Drobo Error");
     }
     else
     {
         if (this._drobos.ContainsKey(drobo.SerialNumber))
         {
             this._drobos[drobo.SerialNumber] = drobo;
         }
         else
         {
             this._drobos.Add(drobo.SerialNumber, drobo);
         }
     }
 }
예제 #4
0
 private void Connection_DataRecieved(IDrobo drobo)
 {
     Console.WriteLine("Drobo data received");
     if (drobo is DroboError)
     {
         Console.WriteLine("Drobo Error");
     }
     else
     {
         if (_drobos.ContainsKey(drobo.NameOfDrobo))
         {
             _drobos[drobo.NameOfDrobo] = drobo;
         }
         else
         {
             _drobos.Add(drobo.NameOfDrobo, drobo);
         }
     }
 }
예제 #5
0
        private IEnumerable<Result> ConvertToResult(IDrobo drobo)
        {
            List<Result> results = new List<Result>();

            double usedPercent =100- Math.Round((drobo.FreeCapacityProtected / drobo.TotalCapacityProtected) * 100,2);

            results.Add(new Result("Used protected space", usedPercent)
            {
                Unit = UnitTypes.Percent,
                Mode = SensorModes.Absolute,
                LimitMaxWarning = 75,
                LimitWarningMsg = "You have less than 25% protected space available",
                LimitMaxError = 90,
                LimitErrorMsg = "You are nearly out of protected space",
                LimitMode = true,
                Float = true
            });

            foreach (var drive in drobo.Drives)
            {
                results.AddRange(ResultForDrive(drive));
            }

            Result freeProtectedSpace = new Result("Free protected space", drobo.FreeCapacityProtected)
            {
                Unit =
                                               UnitTypes.BytesDisk,
                VolumeSize =
                                               SensorSpeedSize
                                               .MegaByte,
            };

            results.Add(freeProtectedSpace);

            Result totalCapacity = new Result("Total Capacity", drobo.TotalCapacityProtected)
                                       {
                                           Unit =
                                               UnitTypes.BytesDisk,
                                           VolumeSize =
                                               SensorSpeedSize
                                               .MegaByte,
                                       };

            results.Add(totalCapacity);
            return results;
        }
예제 #6
0
        private void Connection_DataRecieved(IDrobo drobo)
        {
            Console.WriteLine("Drobo data received");
            if (drobo is DroboError)
            {
                Console.WriteLine("Drobo Error");
            }
            else
            {

                if (this._drobos.ContainsKey(drobo.SerialNumber))
                {
                    this._drobos[drobo.SerialNumber] = drobo;
                }
                else
                {
                    this._drobos.Add(drobo.SerialNumber, drobo);
                }
            }
        }
예제 #7
0
        private IEnumerable<Result> ConvertToResult(IDrobo drobo)
        {
            List<Result> results = new List<Result>();

            foreach (var drive in drobo.Drives)
            {
                results.Add(ResultForDrive(drive));
            }

            results.Add(new Result("Free capacity protected", drobo.FreeCapacityProtected)
                            {
                                Unit = UnitTypes.BytesDisk,
                                Mode = SensorModes.Absolute,
                VolumeSize = SensorSpeedSize.GigaByte,
                Data= DataType.Percent,
                Maximum = drobo.TotalCapacityProtected
            });
            results.Add(new Result("Total Capacity", drobo.UsedCapacityProtected)
                            {
                                Unit = UnitTypes.BytesDisk,
                                VolumeSize = SensorSpeedSize.GigaByte,

                            });
            return results;
        }
예제 #8
0
        private void Connection_DataRecieved(IDrobo drobo)
        {
            Console.WriteLine("Drobo data received");
            if (drobo is DroboError)
            {
                Console.WriteLine("Drobo Error");
            }
            else
            {

                if (_drobos.ContainsKey(drobo.NameOfDrobo))
                {
                    _drobos[drobo.NameOfDrobo] = drobo;
                }
                else
                {
                    _drobos.Add(drobo.NameOfDrobo, drobo);
                }
            }
        }