示例#1
0
		public List<FibreChannelDTOResponse> GetFibreChannelInfo()
		{
			FCInfoDetectorSource fcinfo = new FCInfoDetectorSource();
			List<FibreChannelDTOResponse> fc = fcinfo.GetFibreChannelInfo();
			if (fc.Count == 0) {
				fc = wmiDetector.GetFibreChannelInfo();
			}
			return fc;
		}
示例#2
0
        public List <FibreChannelDTOResponse> GetFibreChannelInfo()
        {
            FCInfoDetectorSource           fcinfo = new FCInfoDetectorSource();
            List <FibreChannelDTOResponse> fc     = fcinfo.GetFibreChannelInfo();

            if (fc.Count == 0)
            {
                fc = wmiDetector.GetFibreChannelInfo();
            }
            return(fc);
        }
示例#3
0
        public List <DiskShareMountDTOResponse> GetDiskShareMountInfo()
        {
            List <DiskShareMountDTOResponse> mounts = new List <DiskShareMountDTOResponse>();
            FCInfoDetectorSource             fcinfo = new FCInfoDetectorSource();

            try
            {
                SelectQuery query = new SelectQuery(
                    @"select Model, DeviceID, Size 
					  from Win32_DiskDrive 
					  where Model like '3PARdata%'"
                    );
                ManagementObjectSearcher searcher = new ManagementObjectSearcher(query);

                foreach (ManagementObject obj in searcher.Get())
                {
                    SelectQuery snQuery = new SelectQuery(
                        "select SerialNumber from Win32_PhysicalMedia " +
                        "where tag='" + GetValueAsString(obj, "DeviceID").Replace(@"\", @"\\") + "'"
                        );
                    ManagementObjectSearcher snSearcher = new ManagementObjectSearcher(snQuery);

                    foreach (ManagementObject snObj in snSearcher.Get())
                    {
                        string serialNumber = fcinfo.GetShareWWN(
                            GetValueAsString(snObj, "SerialNumber")
                            );
                        if (serialNumber.Length == 0)
                        {
                            continue;
                        }
                        DiskShareMountDTOResponse share = new DiskShareMountDTOResponse();
                        share.Volume       = GetValueAsString(obj, "Model");
                        share.SerialNumber = serialNumber;
                        share.Size         = ConvertSizeToMiB(
                            Int64.Parse(GetValueAsString(obj, "Size")),
                            SizeUnits.B
                            ).ToString();

                        mounts.Add(share);

                        break;
                    }
                }
            }
            catch (ManagementException e)
            {
                Logger.Instance.LogError(e.ToString());
            }

            return(mounts);
        }
示例#4
0
		public List<DiskShareMountDTOResponse> GetDiskShareMountInfo()
		{
			List<DiskShareMountDTOResponse> mounts = new List<DiskShareMountDTOResponse>();
			FCInfoDetectorSource fcinfo = new FCInfoDetectorSource();

			try
			{
				SelectQuery query = new SelectQuery(
					@"select Model, DeviceID, Size 
					  from Win32_DiskDrive 
					  where Model like '3PARdata%'"
				);
				ManagementObjectSearcher searcher = new ManagementObjectSearcher(query);
				
				foreach (ManagementObject obj in searcher.Get())
				{
					SelectQuery snQuery = new SelectQuery(
						"select SerialNumber from Win32_PhysicalMedia " +
						"where tag='" + GetValueAsString(obj, "DeviceID").Replace(@"\", @"\\") + "'"
					);
					ManagementObjectSearcher snSearcher = new ManagementObjectSearcher(snQuery);
					
					foreach (ManagementObject snObj in snSearcher.Get())
					{
						string serialNumber = fcinfo.GetShareWWN(
							GetValueAsString(snObj, "SerialNumber")
						);
						if (serialNumber.Length == 0)
						{
						    continue;
						}
						DiskShareMountDTOResponse share = new DiskShareMountDTOResponse();
						share.Volume = GetValueAsString(obj, "Model");
						share.SerialNumber = serialNumber;
						share.Size = ConvertSizeToMiB(
							Int64.Parse(GetValueAsString(obj, "Size")),
							SizeUnits.B
						).ToString();
						
						mounts.Add(share);
						
						break;
					}
				}
			}
			catch (ManagementException e)
			{
				Logger.Instance.LogError(e.ToString());
			}
			
			return mounts;
		}