Class to POST the agent payload data to the Server Density servers.
Example #1
0
        /// <summary>
        /// Performs all checks.
        /// </summary>
        private void DoChecks()
        {
            var results = new Dictionary <string, object>();

            foreach (var check in Checks)
            {
                Log.DebugFormat("{0}: start", check.GetType());
                try
                {
                    var result = check.DoCheck();
                    if (result != null)
                    {
                        results.Add(check.Key, result);
                        Log.DebugFormat("{0}: end", check.GetType());
                    }
                }
                catch (Exception ex)
                {
                    Log.Error(ex);
                }
            }

            // Post metrics to Server Density servers.
            try
            {
                var poster = new PayloadPoster(_config, results);
                poster.Post();
            }
            catch (Exception ex)
            {
                Log.Error(ex);
            }
        }
Example #2
0
        /// <summary>
        /// Performs all checks.
        /// </summary>
        private void DoChecks()
        {
            var results = new Dictionary<string, object>();

            foreach (var check in Checks)
            {
                Log.DebugFormat("{0}: start", check.GetType());
                try
                {
                    var result = check.DoCheck();
                    if (result != null)
                    {
                        results.Add(check.Key, result);
                        Log.DebugFormat("{0}: end", check.GetType());
                    }
                }
                catch (Exception ex)
                {
                    Log.Error(ex);
                }
            }

            // Post metrics to Server Density servers.
            try
            {
                var poster = new PayloadPoster(_config, results);
                poster.Post();
            }
            catch (Exception ex)
            {
                Log.Error(ex);
            }
        }