Ejemplo n.º 1
0
        /// <summary>
        /// Gets device information for logging purposes.
        /// </summary>
        /// <param name="sessionDeviceLogger">The Session device logger to be filled in.</param>
        /// <param name="address">The Device IP Address</param>
        /// <param name="address2">The secondary Device IP Address</param>
        /// <param name="adminPassword">The Device Administrator password</param>
        public static void GetSessionDeviceInfo(SessionDeviceLogger sessionDeviceLogger, IDevice device)
        {
            if (sessionDeviceLogger == null)
            {
                throw new ArgumentNullException(nameof(sessionDeviceLogger));
            }

            if (device == null)
            {
                throw new ArgumentNullException(nameof(device));
            }

            SetDeviceLoggerInfo(sessionDeviceLogger, device);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Sets session device logger values retrieved from the device.
        /// </summary>
        /// <param name="sessionDeviceLogger"></param>
        /// <param name="device"></param>
        private static void SetDeviceLoggerInfo(SessionDeviceLogger sessionDeviceLogger, IDevice device)
        {
            IDeviceInfo deviceInfo = device.GetDeviceInfo();

            sessionDeviceLogger.DeviceName            = deviceInfo.ModelName;
            sessionDeviceLogger.FirmwareRevision      = deviceInfo.FirmwareRevision;
            sessionDeviceLogger.FirmwareDatecode      = deviceInfo.FirmwareDateCode;
            sessionDeviceLogger.FirmwareBundleVersion = GetFimBundle(device);
            sessionDeviceLogger.FirmwareType          = device.FirmwareType;
            sessionDeviceLogger.ModelNumber           = deviceInfo.ModelNumber;

            Snmp snmp = new Snmp(device.Address);

            sessionDeviceLogger.NetworkCardModel        = snmp.Get(_networkCardModelOid);
            sessionDeviceLogger.NetworkInterfaceVersion = snmp.Get(_networkdInterfaceVersionOid);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Gets Jedi Simulator information for logging purposes.
        /// </summary>
        /// <param name="sessionDeviceLogger">The Session device logger to be filled in.</param>
        /// <param name="address">The Device IP Address</param>
        /// <param name="adminPassword">The Device Administrator password</param>
        public static void GetSessionDeviceInfo(SessionDeviceLogger sessionDeviceLogger, string address, string adminPassword)
        {
            if (sessionDeviceLogger == null)
            {
                throw new ArgumentNullException(nameof(sessionDeviceLogger));
            }

            if (string.IsNullOrEmpty(address))
            {
                throw new ArgumentNullException(nameof(address));
            }

            if (string.IsNullOrEmpty(adminPassword))
            {
                throw new ArgumentNullException(nameof(adminPassword));
            }

            using (JediDevice device = new JediDevice(address, adminPassword))
            {
                SetDeviceLoggerInfo(sessionDeviceLogger, device);
            }
        }