Exemplo n.º 1
0
 public static CheckFunctionResult ExecuteCheckFunction(string dll, string modulePath, string name, CheckSettings settings)
 {
     ModuleDomain moduleDomain = GetDomain(dll, modulePath);
     return moduleDomain.ExecuteCheckFunction(Path.GetFullPath(Path.Combine(modulePath, dll)), name, settings);
 }
Exemplo n.º 2
0
 private static AgentConfig LoadSerializedCheck(AgentConfig ac)
 {
     foreach (var _check in ac._checks)
     {
         var checkProperties = GetProperties(_check.Value);
         var checkSettings = new CheckSettings(checkProperties);
         checkSettings.TargetSettings = new Dictionary<string, Dictionary<string, string>>();
         checkSettings.Actions = GetActions(_check.Value);
         checkSettings.Thresholds = GetThresholds(_check.Value);
         var targetSettings = new Dictionary<string, string>();
         foreach (var target in GetTargets(_check.Value))
             checkSettings.TargetSettings.Add(target.Key, targetSettings);
         checkSettings.ParseRaw();
         ac.Checks.Add(_check.Key, checkSettings);
     }
     return ac;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Executes the specific check function
 /// </summary>
 /// <param name="checkProvider"></param>
 /// <param name="name">The exposed name of the function</param>
 /// <param name="settings">The target settings object to pass to the function</param>
 /// <returns></returns>
 public static CheckFunctionResult ExecuteCheckFunction(this ICheckProvider checkProvider, string name, CheckSettings settings)
 {
     return checkProvider.ExecuteFunction(name, settings, "check") as CheckFunctionResult;
 }