Skip to content

Instantly share code, notes, and snippets.

@FrancescoBonizzi
Created October 14, 2021 11:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FrancescoBonizzi/fd2214c00782ea22274242c0455613d8 to your computer and use it in GitHub Desktop.
Save FrancescoBonizzi/fd2214c00782ea22274242c0455613d8 to your computer and use it in GitHub Desktop.
new Rule()
{
RuleName = "RAM full and CPU busy last minute",
BooleanExpression = $"{Metrics.CPUPercentage} and {Metrics.UsedRAMGigaBytes}",
ResultingAlertGravity = AlertGravity.Critical,
MessageFormat = "Attention! Last minute CPU ({0}%) and RAM ({1} GB) are very critical! (Last value collection time: {2})",
TimeFrameMinutes = 1,
DataEvaluationFunctionDescription = new DataEvaluationFunctionDescription[]
{
new DataEvaluationFunctionDescription()
{
Metric = Metrics.CPUPercentage,
Threshold = 90
},
new DataEvaluationFunctionDescription()
{
Metric = Metrics.UsedRAMGigaBytes,
Threshold = 7
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment