static void CIPStatistics(string State)
 {
     if (State.ToUpper() == "START")
     {
         _SystemMonitor.CIP_StatisticsEnable();
     }
     else if (State.ToUpper() == "STOP")
     {
         _SystemMonitor.CIP_StatisticsDisable();
     }
     else
     {
         CrestronConsole.ConsoleCommandResponse("TCIPStatistics [START|STOP]"); return;
     }
     CrestronConsole.ConsoleCommandResponse("CMD:Changing CIP Statistics to {0}...\n", State);
 }
        public static void Start(System_Monitor SystemMonitor)
        {
            _SystemMonitor = SystemMonitor;
            _SystemMonitor.CIP_RX_Count_F_Changed                 += (value) => { CrestronConsole.PrintLine("Sys Mon: CIP_RX_Count_F_Changed: {0}, {1}", value, _SystemMonitor.CIP_RX_Count_F); };
            _SystemMonitor.CIP_StatisticsEnable_F_Changed         += (value) => { CrestronConsole.PrintLine("Sys Mon: CIP_StatisticsEnable_F_Changed: {0}, {1}", value, _SystemMonitor.CIP_StatisticsEnable_F); };
            _SystemMonitor.CIP_TotalCount_F_Changed               += (value) => { CrestronConsole.PrintLine("Sys Mon: CIP_TotalCount_F_Changed: {0}, {1}", value, _SystemMonitor.CIP_TotalCount_F); };
            _SystemMonitor.CIP_TX_Count_F_Changed                 += (value) => { CrestronConsole.PrintLine("Sys Mon: CIP_TX_Count_F_Changed: {0}, {1}", value, _SystemMonitor.CIP_TX_Count_F); };
            _SystemMonitor.CPU_Utilization_F_Changed              += (value) => { CrestronConsole.PrintLine("Sys Mon: CPU_Utilization_F_Changed: {0}, {1}", value, _SystemMonitor.CPU_Utilization_F); };
            _SystemMonitor.CPU_UtilizationEnable_F_Changed        += (value) => { CrestronConsole.PrintLine("Sys Mon: CPU_UtilizationEnable_F_Changed: {0}, {1}", value, _SystemMonitor.CPU_UtilizationEnable_F); };
            _SystemMonitor.CresnetRX_Count_F_Changed              += (value) => { CrestronConsole.PrintLine("Sys Mon: CresnetRX_Count_F_Changed: {0}, {1}", value, _SystemMonitor.CresnetRX_Count_F); };
            _SystemMonitor.CresnetRX_UtilizationCount_F_Changed   += (value) => { CrestronConsole.PrintLine("Sys Mon: CresnetRX_UtilizationCount_F_Changed: {0}, {1}", value, _SystemMonitor.CresnetRX_UtilizationCount_F); };
            _SystemMonitor.CresnetStatisticsEnable_F_Changed      += (value) => { CrestronConsole.PrintLine("Sys Mon: CresnetStatisticsEnable_F_Changed: {0}, {1}", value, _SystemMonitor.CresnetStatisticsEnable_F); };
            _SystemMonitor.CresnetTotalCount_F_Changed            += (value) => { CrestronConsole.PrintLine("Sys Mon: CresnetTotalCount_F_Changed: {0}, {1}", value, _SystemMonitor.CresnetTotalCount_F); };
            _SystemMonitor.CresnetTotalUtilizationCount_F_Changed += (value) => { CrestronConsole.PrintLine("Sys Mon: CresnetTotalUtilizationCount_F_Changed: {0}, {1}", value, _SystemMonitor.CresnetTotalUtilizationCount_F); };
            _SystemMonitor.CresnetTX_Count_F_Changed              += (value) => { CrestronConsole.PrintLine("Sys Mon: CresnetTX_Count_F_Changed: {0}, {1}", value, _SystemMonitor.CresnetTX_Count_F); };
            _SystemMonitor.CresneTX_UtilizationCount_F_Changed    += (value) => { CrestronConsole.PrintLine("Sys Mon: CresneTX_UtilizationCount_F_Changed: {0}, {1}", value, _SystemMonitor.CresnetTX_UtilizationCount_F); };
            _SystemMonitor.ErrorLogErrorCount_F_Changed           += (value) => { CrestronConsole.PrintLine("Sys Mon: ErrorLogErrorCount_F_Changed: {0}, {1}", value, _SystemMonitor.ErrorLogErrorCount_F); };
            _SystemMonitor.ErrorLogNoticeCount_F_Changed          += (value) => { CrestronConsole.PrintLine("Sys Mon: ErrorLogNoticeCount_F_Changed: {0}, {1}", value, _SystemMonitor.ErrorLogNoticeCount_F); };
            _SystemMonitor.ErrorLogStatisticsEnable_F_Changed     += (value) => { CrestronConsole.PrintLine("Sys Mon: ErrorLogStatisticsEnable_F_Changed: {0}, {1}", value, _SystemMonitor.ErrorLogStatisticsEnable_F); };
            _SystemMonitor.ErrorLogWarningCount_F_Changed         += (value) => { CrestronConsole.PrintLine("Sys Mon: ErrorLogWarningCount_F_Changed: {0}, {1}", value, _SystemMonitor.ErrorLogWarningCount_F); };
            _SystemMonitor.HeapFree_F_Changed                        += (value) => { CrestronConsole.PrintLine("Sys Mon: HeapFree_F_Changed: {0}, {1}", value, _SystemMonitor.HeapFree_F); };
            _SystemMonitor.HeapFreeMin_F_Changed                     += (value) => { CrestronConsole.PrintLine("Sys Mon: HeapFreeMin_F_Changed: {0}, {1}", value, _SystemMonitor.HeapFreeMin_F); };
            _SystemMonitor.MaxCIP_RX_Count_F_Changed                 += (value) => { CrestronConsole.PrintLine("Sys Mon: MaxCIP_RX_Count_F_Changed: {0}, {1}", value, _SystemMonitor.MaxCIP_RX_Count_F); };
            _SystemMonitor.MaxCIP_TotalCount_F_Changed               += (value) => { CrestronConsole.PrintLine("Sys Mon: MaxCIP_TotalCount_F_Changed: {0}, {1}", value, _SystemMonitor.MaxCIP_TotalCount_F); };
            _SystemMonitor.MaxCIP_TX_Count_F_Changed                 += (value) => { CrestronConsole.PrintLine("Sys Mon: MaxCIP_TX_Count_F_Changed: {0}, {1}", value, _SystemMonitor.MaxCIP_TX_Count_F); };
            _SystemMonitor.MaxCPU_Utilization_F_Changed              += (value) => { CrestronConsole.PrintLine("Sys Mon: MaxCPU_Utilization_F_Changed: {0}, {1}", value, _SystemMonitor.MaxCPU_Utilization_F); };
            _SystemMonitor.MaxCresnetRX_Count_F_Changed              += (value) => { CrestronConsole.PrintLine("Sys Mon: MaxCresnetRX_Count_F_Changed: {0}, {1}", value, _SystemMonitor.MaxCresnetRX_Count_F); };
            _SystemMonitor.MaxCresnetRX_UtilizationCount_F_Changed   += (value) => { CrestronConsole.PrintLine("Sys Mon: MaxCresnetRX_UtilizationCount_F_Changed: {0}, {1}", value, _SystemMonitor.MaxCresnetRX_UtilizationCount_F); };
            _SystemMonitor.MaxCresnetTotalCount_F_Changed            += (value) => { CrestronConsole.PrintLine("Sys Mon: MaxCresnetTotalCount_F_Changed: {0}, {1}", value, _SystemMonitor.MaxCresnetTotalCount_F); };
            _SystemMonitor.MaxCresnetTotalUtilizationCount_F_Changed += (value) => { CrestronConsole.PrintLine("Sys Mon: MaxCresnetTotalUtilizationCount_F_Changed: {0}, {1}", value, _SystemMonitor.MaxCresnetTotalUtilizationCount_F); };
            _SystemMonitor.MaxCresnetTX_Count_F_Changed              += (value) => { CrestronConsole.PrintLine("Sys Mon: MaxCresnetTX_Count_F_Changed: {0}, {1}", value, _SystemMonitor.MaxCresnetTX_Count_F); };
            _SystemMonitor.MaxCresnetTX_UtilizationCount_F_Changed   += (value) => { CrestronConsole.PrintLine("Sys Mon: MaxCresnetTX_UtilizationCount_F_Changed: {0}, {1}", value, _SystemMonitor.MaxCresnetTX_UtilizationCount_F); };
            _SystemMonitor.MaxProcesses_F_Changed                    += (value) => { CrestronConsole.PrintLine("Sys Mon: MaxProcesses_F_Changed: {0}, {1}", value, _SystemMonitor.MaxProcesses_F); };
            _SystemMonitor.MaxTCP_RX_Count_F_Changed                 += (value) => { CrestronConsole.PrintLine("Sys Mon: MaxTCP_RX_Count_F_Changed: {0}, {1}", value, _SystemMonitor.MaxTCP_RX_Count_F); };
            _SystemMonitor.MaxTCP_TotalCount_F_Changed               += (value) => { CrestronConsole.PrintLine("Sys Mon: MaxTCP_TotalCount_F_Changed: {0}, {1}", value, _SystemMonitor.MaxTCP_TotalCount_F); };
            _SystemMonitor.MaxTCP_TX_Count_F_Changed                 += (value) => { CrestronConsole.PrintLine("Sys Mon: MaxTCP_TX_Count_F_Changed: {0}, {1}", value, _SystemMonitor.MaxTCP_TX_Count_F); };
            _SystemMonitor.NumProcesses_F_Changed                    += (value) => { CrestronConsole.PrintLine("Sys Mon: NumProcesses_F_Changed: {0}, {1}", value, _SystemMonitor.NumProcesses_F); };
            _SystemMonitor.ProcessStatisticsEnable_F_Changed         += (value) => { CrestronConsole.PrintLine("Sys Mon: ProcessStatisticsEnable_F_Changed: {0}, {1}", value, _SystemMonitor.ProcessStatisticsEnable_F); };
            _SystemMonitor.SysmonStarted_F_Changed                   += (value) => { CrestronConsole.PrintLine("Sys Mon: SysmonStarted_F_Changed: {0}, {1}", value, _SystemMonitor.SysmonStarted_F); };
            _SystemMonitor.TCP_RX_Count_F_Changed                    += (value) => { CrestronConsole.PrintLine("Sys Mon: TCP_RX_Count_F_Changed: {0}, {1}", value, _SystemMonitor.TCP_RX_Count_F); };
            _SystemMonitor.TCP_StatisticsEnable_F_Changed            += (value) => { CrestronConsole.PrintLine("Sys Mon: TCP_StatisticsEnable_F_Changed: {0}, {1}", value, _SystemMonitor.TCP_StatisticsEnable_F); };
            _SystemMonitor.TCP_TotalCount_F_Changed                  += (value) => { CrestronConsole.PrintLine("Sys Mon: TCP_TotalCount_F_Changed: {0}, {1}", value, _SystemMonitor.TCP_TotalCount_F); };
            _SystemMonitor.TCP_TX_Count_F_Changed                    += (value) => { CrestronConsole.PrintLine("Sys Mon: TCP_TX_Count_F_Changed: {0}, {1}", value, _SystemMonitor.TCP_TX_Count_F); };
            _SystemMonitor.TotalHeapSpace_F_Changed                  += (value) => { CrestronConsole.PrintLine("Sys Mon: TotalHeapSpace_F_Changed: {0}, {1}", value, _SystemMonitor.TotalHeapSpace_F); };

            CrestronConsole.AddNewConsoleCommand(Sysmon, "TSysmon", "Start/Stop System Monitor for System Monitor", ConsoleAccessLevelEnum.AccessOperator);
            CrestronConsole.AddNewConsoleCommand(ResetMax, "TResetMax", "Reset Max Stats for System Monitor", ConsoleAccessLevelEnum.AccessOperator);
            CrestronConsole.AddNewConsoleCommand(ProcessStatiscs, "TProcessStatistics", "Start/Stop Process Statistics for System Monitor", ConsoleAccessLevelEnum.AccessOperator);
            CrestronConsole.AddNewConsoleCommand(CresnetStatistics, "TCresnetStatistics", "Start/Stop Cresnet Statistics for System Monitor", ConsoleAccessLevelEnum.AccessOperator);
            CrestronConsole.AddNewConsoleCommand(TCPStatistics, "TTCPStatistics", "Start/Stop TCP Statistics for System Monitor", ConsoleAccessLevelEnum.AccessOperator);
            CrestronConsole.AddNewConsoleCommand(CIPStatistics, "TCIPStatistics", "Start/Stop CIP Statistics for System Monitor", ConsoleAccessLevelEnum.AccessOperator);
            CrestronConsole.AddNewConsoleCommand(CPUUtilization, "TCPUUtilization", "Start/Stop CPU Utilization for System Monitor", ConsoleAccessLevelEnum.AccessOperator);
            CrestronConsole.AddNewConsoleCommand(ErrorLogStatistics, "TErrorLogStatistics", "Start/Stop Error Log Statistics for System Monitor", ConsoleAccessLevelEnum.AccessOperator);
            CrestronConsole.AddNewConsoleCommand(UpdateInterval, "TUpdateInterval", "Start/Stop Update Interval for System Monitor", ConsoleAccessLevelEnum.AccessOperator);
            CrestronConsole.AddNewConsoleCommand(CresnetStatisticsMode, "TCresnetStatisticsMode", "Set Cresnet Statistics Mode for System Monitor", ConsoleAccessLevelEnum.AccessOperator);
            CrestronConsole.AddNewConsoleCommand(TCPStatisticsMode, "TTCPStatisticsMode", "Set TCP Statistics Mode for System Monitor", ConsoleAccessLevelEnum.AccessOperator);
            CrestronConsole.AddNewConsoleCommand(CIPStatisticsMode, "TCIPStatisticsMode", "Set CIP Statistics Mode for System Monitor", ConsoleAccessLevelEnum.AccessOperator);
            CrestronConsole.AddNewConsoleCommand(GetStatsState, "TGetStatsState", "Get enable/disable statuses", ConsoleAccessLevelEnum.AccessOperator);
            CrestronConsole.AddNewConsoleCommand(GetAllStats, "TGetAllStats", "Get All Statistics", ConsoleAccessLevelEnum.AccessOperator);

            _SystemMonitor.StartSysmon();
            _SystemMonitor.ProcessStatisticsEnable();
            _SystemMonitor.CresnetStatisticsEnable();
            _SystemMonitor.TCP_StatisticsEnable();
            _SystemMonitor.CIP_StatisticsEnable();
            _SystemMonitor.CPU_UtilizationEnable();
            _SystemMonitor.ErrorLogStatisicsEnable();
        }