# Multiple merge on the same panel

**URL:** <https://community.grafana.com/t/multiple-merge-on-the-same-panel/45908>\
**Category:** Grafana\
**Created:** [April 12, 2021, 11:06am UTC](https://community.grafana.com/t/multiple-merge-on-the-same-panel/45908 "2021-04-12T11:06:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![imanolseim1](https://avatars.discourse-cdn.com/v4/letter/i/8edcca/32.png) [@imanolseim1](https://community.grafana.com/u/imanolseim1)\
**Post date:** [April 12, 2021, 11:06am UTC](https://community.grafana.com/t/multiple-merge-on-the-same-panel/45908/1 "2021-04-12T11:06:22Z")

</div>

Hi all, I’m kinda new using Grafana and I would like to know if there is any option to make two merges in the same panel about different queries that are inside of it. Also, does anyone know any site which says how to use variables when you are using pnp4nagios as datasource? I couldn’t find anything about it.

Sorry if my english is bad, not my best languague.  
Thanks for all.

---

<div class="post-metadata">

**Author:** ![pooh](https://avatars.discourse-cdn.com/v4/letter/p/f05b48/32.png) [@pooh](https://community.grafana.com/u/pooh)\
**Post date:** [April 12, 2021, 11:20am UTC](https://community.grafana.com/t/multiple-merge-on-the-same-panel/45908/2 "2021-04-12T11:20:43Z")

</div>

> Hi all, I’m kinda new using Grafana and I would like to know if there is  
> any option to make two merges in the same panel about different queries  
> that are inside of it.

Please can you explain what you mean by “two merges”. Maybe give us an  
example to show what you would like to achieve?

> Also, does anyone know any site which says how to use variables when you are  
> using pnp4nagios as datasource? I couldn’t find anything about it.

I don’t understand “using pnp4nagios as a data source”.

pnp4nagios is not a data store - it’s a method of representing data from a  
data store, which is also what Grafana is.

[Data sources | Grafana documentation](https://grafana.com/docs/grafana/latest/datasources/) tells you which back-end  
data stores are supported by Grafana. If your implementation of pnp4nagios is  
taking data from one of those, then Grafana can too.

Antony.

---

<div class="post-metadata">

**Author:** ![imanolseim1](https://avatars.discourse-cdn.com/v4/letter/i/8edcca/32.png) [@imanolseim1](https://community.grafana.com/u/imanolseim1)\
**Post date:** [April 12, 2021, 11:33am UTC](https://community.grafana.com/t/multiple-merge-on-the-same-panel/45908/3 "2021-04-12T11:33:40Z")

</div>

Yes sorry for the confusion I’ll try to explain as good as I can.

> Please can you explain what you mean by “two merges”. Maybe give us an  
> example to show what you would like to achieve?

I would like to have 2 “squares” where each one of them represents multiple windows services monitorized, if I would want only one “square” I should just transform and merge all, but can I only merge for example 4 of the 6 queries that are inside the panel and then merge the other 2 in another square?

Here is an image to try to clear the “square” thing: [Imgur: The magic of the Internet](https://imgur.com/EepMYGs)

> I don’t understand “using pnp4nagios as a data source”.

True, my bad about this one too, I have monitorized some hosts and services with Nagios and then using PNP included to Grafana, the thing is that I don’t know how to make variable queries because most of the other examples are from PostgresSQL/InfluxDB etc. which I dont have. I tried to know/understand from where I’m getting all the data but it seems like the MariaDB that I have installed doesnt collect any data, is there any option to know that?

---

<div class="post-metadata">

**Author:** ![pooh](https://avatars.discourse-cdn.com/v4/letter/p/f05b48/32.png) [@pooh](https://community.grafana.com/u/pooh)\
**Post date:** [April 12, 2021, 12:11pm UTC](https://community.grafana.com/t/multiple-merge-on-the-same-panel/45908/4 "2021-04-12T12:11:12Z")

</div>

> Yes sorry for the confusion I’ll try to explain as good as I can.
> 
> > Please can you explain what you mean by “two merges”. Maybe give us an  
> > example to show what you would like to achieve?
> 
> I would like to have 2 “squares” where each one of them represents multiple  
> windows services monitorized, if I would want only one “square” I should  
> just transform and merge all, but can I only merge for example 4 of the 6  
> queries that are inside the panel and then merge the other 2 in another  
> square?
> 
> Here is an image to try to clear the “square” thing:  
> [Imgur: The magic of the Internet](https://imgur.com/EepMYGs)

No, I’m sorry but I still don’t understand what you want to do, and that link  
shows me a dark grey background in my browser and nothing else.

> I have monitorized some hosts and services with Nagios and then using PNP  
> included to Grafana, the thing is that I don’t know how to make variable  
> queries because most of the other examples are from PostgresSQL/InfluxDB etc.  
> which I dont have. I tried to know/understand from where I’m getting all the  
> data but it seems like the MariaDB that I have installed doesnt collect any  
> data, is there any option to know that?

If you have installed Nagios and PNP4Nagios in “the standard way” then the  
data being shown in PNP4Nagios is being stored in an RRD database, which:

a) I do not believe can be queried by Grafana

b) strikes me as a bad choice for a data store to use with Grafana queries  
(even if it were possible), because RRD inherently deletes / amalgamates older  
data to conserve storage space. If you store one data point per minute in  
RRD, then the data from a year ago probably only exists as one point per hour  
or one point per day.

It sounds to me that you need to select a data store which is supported by  
Grafana, and can be written to by Nagios (since that’s where your data is  
ultimately coming from), then you will have data coming in from your service  
checks, being displayed in Nagios, also being fed into RRD for PNP4Nagios, and  
going to a data store which Grafana can use.

I hope that helps,

Antony.

---

<div class="post-metadata">

**Author:** ![imanolseim1](https://avatars.discourse-cdn.com/v4/letter/i/8edcca/32.png) [@imanolseim1](https://community.grafana.com/u/imanolseim1)\
**Post date:** [April 13, 2021, 8:04am UTC](https://community.grafana.com/t/multiple-merge-on-the-same-panel/45908/5 "2021-04-13T08:04:38Z")

</div>

Hi Antony, I finally solved the second problem but it maintains the first one. The thing is that when you create a new panel you can place some queries just like the follow image.

[[Album] imgur.com ![](https://i.imgur.com/ZAU7t4K.png?fb "imgur.com") ](https://imgur.com/a/gGSf0gG)

Following this example, if I had 7 queries but I want to divide them in 2 big groups (imagine that I have two servers, on the first one there are 3 services monitorized and at the other one 4), but I’m trying to show only with 1 green/red rectangle (per server, two in total) that depends the color change if one of those services are up or not, what would be the procedure to make it?

Sorry for all the inconveniences and thanks for replying.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/grafana/original/2X/e/ef5308cc58c9e5a13187b5012eb99f406928462f.png) [@system](https://community.grafana.com/u/system)\
**Post date:** [April 12, 2022, 11:06am UTC](https://community.grafana.com/t/multiple-merge-on-the-same-panel/45908/6 "2022-04-12T11:06:44Z")

</div>

This topic was automatically closed after 365 days. New replies are no longer allowed.
