Пример #1
0
        //protected void Page_Load(object sender, EventArgs e)
        //{
        //    LoadInformation(GetSystemInfo());
        //    LoadInformation(GetSystemProcessorInfo());
        //    LoadInformation(GetSystemMemoryInfo());
        //    LoadInformation(GetSystemStorageInfo());
        //    LoadInformation(GetRequestHeaderInfo());
        //    LoadInformation(GetServerVariables());
        //    LoadInformation(GetEnvironmentVariables());
        //    LoadInformation(GetSessionInfo());
        //    LoadInformation(GetSystemObjectInfo());
        //    LoadInformation(GetMailObjectInfo());
        //    LoadInformation(GetUploadObjectInfo());
        //    LoadInformation(GetGraphicsObjectInfo());
        //    LoadInformation(GetOtherObjectInfo());
        //}
        private DataTable GetSystemInfo()
        {
            DataTable table = GenerateDataTable("System Information");

            //	Server Name
            Assign(table, "Server Name", HttpContext.Current.Server.MachineName);
            Assign(table, "Server IP", HttpContext.Current.Request.ServerVariables["LOCAl_ADDR"]);
            Assign(table, "Server Domain", HttpContext.Current.Request.ServerVariables["Server_Name"]);
            Assign(table, "Server Port", HttpContext.Current.Request.ServerVariables["Server_Port"]);
            //	Web Server
            Assign(table, "Web Server Version", HttpContext.Current.Request.ServerVariables["Server_SoftWare"]);
            //	Path
            Assign(table, "Virtual Request Path", HttpContext.Current.Request.FilePath);
            Assign(table, "Physical Request Path", HttpContext.Current.Request.PhysicalPath);
            Assign(table, "Virtual Application Root Path", HttpContext.Current.Request.ApplicationPath);
            Assign(table, "Physical Application Root Path", HttpContext.Current.Request.PhysicalApplicationPath);

            Assign(table, "Operating System", OperatingSystemOSVersion);
            Assign(table, "Operating System Installation Directory", Environment.SystemDirectory);
            Assign(table, ".Net Version", DotNetVersion.ToString());
            Assign(table, ".Net Language", DotNetLanguage);
            Assign(table, "Server Current Time", DateTime.Now.ToString());
            Assign(table, "System Uptime", SystemUptime.ToString());
            Assign(table, "Script Timeout", ScriptTimeout.ToString());
            return(table);
        }
Пример #2
0
        public OnuGeneric(uint oltId, uint oltPortId, uint oltOnuId, IResponseDescriptionDictionaries responseDescriptionDictionaries, IDataService snmpDataService)
        {
            _responseDescriptionDictionaries = responseDescriptionDictionaries;
            _snmpDataService = snmpDataService;

            OltId     = oltId;
            OltPortId = oltPortId;
            OltOnuId  = oltOnuId;

            ModelType        = new ModelType();
            DescriptionName  = new DescriptionName();
            GponSerialNumber = new GponSerialNumber();
            GponProfile      = new GponProfile();

            OpticalConnectionState = new OpticalConnectionState(_responseDescriptionDictionaries);
            OpticalConnectionDeactivationReason = new OpticalConnectionDeactivationReason(_responseDescriptionDictionaries);
            OpticalPowerReceived          = new OpticalPowerReceived();
            OpticalCableDistance          = new OpticalCableDistance();
            OpticalConnectionUptime       = new OpticalConnectionUptime();
            OpticalConnectionInactiveTime = new OpticalConnectionInactiveTime();
            SystemUptime = new SystemUptime();
            BlockStatus  = new BlockStatus(_responseDescriptionDictionaries);
            BlockReason  = new BlockReason(_responseDescriptionDictionaries);

            ModelType.Value        = _snmpDataService.GetStringPropertyAsync(oltId, SnmpOIDCollection.snmpOIDGetOnuModelType + "." + oltPortId + "." + oltOnuId).Result;
            DescriptionName.Value  = _snmpDataService.GetStringPropertyAsync(oltId, SnmpOIDCollection.snmpOIDOnuDescription + "." + oltPortId + "." + oltOnuId).Result;
            GponSerialNumber.Value = _snmpDataService.GetStringPropertyAsync(oltId, SnmpOIDCollection.snmpOIDOnuGponSerialNumber + "." + oltPortId + "." + oltOnuId).Result;
            GponProfile.Value      = _snmpDataService.GetStringPropertyAsync(oltId, SnmpOIDCollection.snmpOIDOnuGponProfile + "." + oltPortId + "." + oltOnuId).Result;

            OpticalConnectionState.Value = _snmpDataService.GetIntPropertyAsync(oltId, SnmpOIDCollection.snmpOIDOnuOpticalConnectionState + "." + oltPortId + "." + oltOnuId).Result;
            OpticalConnectionDeactivationReason.Value = _snmpDataService.GetIntPropertyAsync(oltId, SnmpOIDCollection.snmpOIDOnuOpticalConnectionDeactivationReason + "." + oltPortId + "." + oltOnuId).Result;
            OpticalPowerReceived.Value = _snmpDataService.GetStringPropertyAsync(oltId, SnmpOIDCollection.snmpOIDOnuOpticalPowerReceived + "." + oltPortId + "." + oltOnuId).Result;
            OpticalCableDistance.Value = _snmpDataService.GetIntPropertyAsync(oltId, SnmpOIDCollection.snmpOIDOnuOpticalCabelDistance + "." + oltPortId + "." + oltOnuId).Result;

            if (_snmpDataService.GetOltFirmwareVersionAsync(oltId).Result != "5.01")
            {
                OpticalConnectionUptime.Value       = _snmpDataService.GetIntPropertyAsync(oltId, SnmpOIDCollection.snmpOIDOnuOpticalConnectionUptime + "." + oltPortId + "." + oltOnuId).Result;
                OpticalConnectionInactiveTime.Value = _snmpDataService.GetIntPropertyAsync(oltId, SnmpOIDCollection.snmpOIDOnuOpticalConnectionInactiveTime + "." + oltPortId + "." + oltOnuId).Result;
                SystemUptime.Value = _snmpDataService.GetIntPropertyAsync(oltId, SnmpOIDCollection.snmpOIDOnuSystemUptime + "." + oltPortId + "." + oltOnuId).Result;
            }

            BlockStatus.Value = _snmpDataService.GetIntPropertyAsync(oltId, SnmpOIDCollection.snmpOIDOnuBlockStatus + "." + oltPortId + "." + oltOnuId).Result;
            BlockReason.Value = _snmpDataService.GetIntPropertyAsync(oltId, SnmpOIDCollection.snmpOIDOnuBlockReason + "." + oltPortId + "." + oltOnuId).Result;
        }
Пример #3
0
        public void GetLastRestartTimeTest()
        {
            var actual = SystemUptime.GetLastRestartTime();

            Assert.IsTrue(actual < DateTime.Now, "Restart time is in the future, which does not make sense.");
        }
Пример #4
0
 void OnGUI()
 {
     GUILayout.Label("Uptime: " + SystemUptime.GetDeviceUptime(), LabelStyle);
 }