Host not reporting with a NRQL alert

Hi everyone,

I’m using terraform to deploy alerts, and reviewing the documentation about the " newrelic_infra_alert_condition" it says that it’s prefered to use " newrelic_nrql_alert_condition" since some of the other resources may be deprecated in the future.

I’ve updated all of our alerts but one, “host not reporting”. I couldn’t make this one with a NRQL alert.

Anyone knows how to do it? I’ve tried some queries but none worked.


Hi there @ionut.alexandrupetri - welcome to the community!

This topic may get you what you are looking for:

Please let me know if it does not!

Using uniqueCount() or uniques() works great if you’re doing manual work, but an alert condition needs numbers, so uniques() will probably not work for this. uniqueCount() might, but if the number of hosts you’re running changes, then your threshold will no longer be valid.

Instead, I would recommend using something along the lines of SELECT count(*) FROM SystemSample FACET hostname, and then setting up a Loss of Signal to actually detect when a host loses connection.

1 Like


This works perfectly. I used “SELECT filter(uniqueCount(hostStatus), WHERE hostStatus=‘shutdown’) from SystemSample facet hostname” and a signal loss after 5 minutes.

1 Like