Alerting Question

Is there a way to alert on a growing value of servers and healthy servers?

For example:
I have one query with the server count and another one with a healthy server count. I want to be able to alert if my healthy server count is below the main server count.

Here I have 45 healthy servers out of 50 (45/50), but the 50 count depending on traffic will grow. I need an alert letting me know 5 servers are bad.

Thank you