private void InitializeConfig()
{
try
{
Checks.Add(new SystemStatsCheck());
_networkTrafficCheck = new NetworkTrafficCheck();
Checks.Add(_networkTrafficCheck);
Checks.Add(new DriveInfoBasedDiskUsageCheck());
Checks.Add(new ProcessorCheck());
Checks.Add(new ProcessCheck());
Checks.Add(new PhysicalMemoryFreeCheck());
Checks.Add(new PhysicalMemoryUsedCheck());
Checks.Add(new PhysicalMemoryCachedCheck());
Checks.Add(new SwapMemoryFreeCheck());
Checks.Add(new SwapMemoryUsedCheck());
Checks.Add(new IOCheck());
if (_config.IISStatus)
{
Checks.Add(new IISCheck());
}
if (_config.PluginDirectory != null && Directory.Exists(_config.PluginDirectory))
{
Checks.Add(new PluginCheck(_config.PluginDirectory));
}
if (_config.SQLServerStatus)
{
Checks.Add(new SQLServerCheck(_config.CustomPrefix));
}
if (!string.IsNullOrEmpty(_config.MongoDBConnectionString))
{
Checks.Add(new ExtendedMongoDBCheck(_config.MongoDBConnectionString, _config.MongoDBReplSet, _config.MongoDBDBStats));
}
// flag check
if (Agent.Flags.ContainsKey("FlagCheck"))
{
Log.Warn("Flag check activated");
}
}
catch (Exception ex)
{
Log.Error(ex);
}
}