Ad Widget

Collapse

Host availability panel in Grafana

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Raaweni
    Junior Member
    • Mar 2021
    • 6

    #1

    Host availability panel in Grafana

    (Zabbix 5.4.11, Grafana Enterprise 8.4.4.1, Mariadb 10.3.28-1)

    Hi everybody!

    I know this may be an issue at Grafana's end or may need direct queries to the Zabbix database, but I can't seem to get a panel much like the Zabbix's "Host availability" -widget working in Grafana.


    Click image for larger version  Name:	zabbix.png Views:	0 Size:	18.4 KB ID:	444104

    What I (read: my managers) would like to have is a traffic lights kind of webpage showing how many servers in a host group are up and how many down. So pretty much what the "Host availability" -widget does in Zabbix. I know I could create a dashboard in Zabbix and share that, but apparently the management likes the outlook of Grafana's dashboards better.

    The connection ie. Zabbix datasource works fine in Grafana. I can get the needed up/down information on hosts available. I can also get a big view of hosts in a hostgroup showing either red or green for each host according to its status. But what I can't seem to be able to get working is a single counter showing how many servers are 'green' and how many are 'red'.

    So why am I asking about this in here rather than the Grafana community? Well I'm not sure if it's something that I must do at Grafana's end or if there's a way to grab the information directly from Zabbix. Or perhaps I could do a mysql-query directly from the Zabbix database and count the number of ones and zeros? It's just that I'm not very skilled in sql an I looking at the database tables, I wasn't able to find where the item Zabbix agent availability stores its values.


    Click image for larger version  Name:	grafana.png Views:	0 Size:	7.0 KB ID:	444105

    Any help would really be appreciated!

    Thanks

    - Pekka
    Last edited by Raaweni; 04-05-2022, 10:13.
  • Kaiser
    Junior Member
    • Jun 2024
    • 1

    #2
    Hi,

    This is not exactly what we have on Zabbix, but gives the same info and its pretty similar. The colors doesnt matter, cause you can customize them as you wish on Grafana.

    I'm using Grafana 11 and Zabbix Plugin 4.4.8 with a Zabbix v.6


    ​How to do those Dashboards?

    1- All
    1.1 Query the info on Grafana From Zabbix, in this case I'm checking the availability by the Item "ICMP Ping" that brings me "1" or "0" depending if is up or down.
    ​ ​
    1.2 Depending on the Visualization you are using you will get displayed every host by itself. We will use 3 transformations, to get to that unique value that is the "Count" of items.
    1.3 Use the reduce transformation to get an unique value of every host. Remember that Grafana queries series from Zabbix divided by timestamps. I did it using the "Last" value, to get "0 or 1" that indicates if the host is up or down

    1.4 2nd, Reduce again selecting "count" to have the "total amount"​ of hosts. Remember that it will use the "1 or 0" corresponding to the availability of the host.

    1.5 3rd Filter by name and just look for the "Last"


    2. - UP
    2.1 It's the same as "All Dashboard" but on 1.4 step choose "Total". This is going to sum the values, so if there is one down, the sum will give you 26/27​​

    Click image for larger version

Name:	image.png
Views:	1214
Size:	37.6 KB
ID:	485430

    3- Down
    3.1 Same as ​"Up Dashboard" but adding a Filter between the Reduces, to exclude all "1"

    Click image for larger version

Name:	image.png
Views:	1305
Size:	31.3 KB
ID:	485429


    In Case you want to know the one that is down.

    Click image for larger version

Name:	image.png
Views:	1222
Size:	64.4 KB
ID:	485431​​​

    Comment

    • Pablok
      Junior Member
      • Apr 2023
      • 4

      #3
      Hi,
      Can you reload images of steps 1 through 2? It doesn't appears any images...
      Thank you in advance...!!

      Comment

      • Soualder
        Junior Member
        • May 2025
        • 1

        #4
        Hello Kaiser Could you post the images again? I'm new to grafana and don't have much experience, the images will help a lot, thank you!

        Comment

        Working...