How to make the number of available hosts in Grafana (Zabbix)?

There are Zabbix 3.2, there is a Grafana, which displays beautiful graphs on the basis of metrics Zabbix.
I want to make the counter available/problematic/unavailable hosts in a pie chart.

Hosts are polled via SNMP and/or ICMP ping.
There are those who are polled simultaneously and pinouts and SNMP (the SNMP is always some available - for example, if the host is not configured SNMP, although the network [by ping] they are present and must be included in available).

Is there a ready solution for such a meter or will have to collect data directly from the database?
Picking table `zabbix`.`hosts`, but the maximum that can be there to pull the snmp status.
But some hosts, like I said above, give "snmp is not available", but is available for ICMP.
June 5th 19 at 21:46

Find more questions by tags DatabasesMonitoringZabbix