How to count CPU usage and memory usage at the same time

When the CPU utilization rate is greater than 80% and the memory utilization rate is greater than 90%, an alarm is generated.

I can’t find a way to deal with this situation in the official documents.

I need your help. Thank you very much.