Alerting problem

I have 2 hosts, collecting system data every 10s and sending it to a database. If you do not receive one of the host data alarm. But only when the two hosts have no data to alarm.

I have two ways to solve:

1.Set a query for each host and set Conditions for each query
This method is cumbersome if I have many hosts

2.Count_non_null () to count the number of 1 minute database received. 10s to collect a data, through a minute can count 5 to 6 times, so the number of times less than 3 times to alarm

I would like to ask if there is any better way to solve this problem?