neuralfraud / grafana-prtg

A PRTG Datasource plugin for Grafana
180 stars 75 forks source link

Lost Host portion of label #47

Open Liquidmantis opened 7 years ago

Liquidmantis commented 7 years ago

I just installed the 4.0 release yesterday and I'm having to rejigger my dashboards. It just requires touching them to refresh, but what I'm seeing now is that the Host is no longer displayed. I can check "Include Sensor Name" but that just adds the relative sensor name and the actual host is still unclear.

Here's an example graph of multiple servers overlaid on the same graph, with Inc Sensor checked: image

neuralfraud commented 7 years ago

@Liquidmantis Documentation fail on my part. The host isn't displayed unless there are multiple hosts in a single query. You can effectively rewrite that dashboard to use a single query by say, selecting group hosts and /Hyper-V Network/ for the "sensor" field and boom. You can also select whether or not to display the sensor name.

Liquidmantis commented 7 years ago

That's great! This is way better. Did this not work before? I swear I tried wildcarding before 4.0 and it didn't work, which is why I've been using the explicit listing. This, however, will make it so much easier to create these dashboards.

Thanks!

Liquidmantis commented 7 years ago

Okay, this does cause an issue in that so far I have to show the entire group. Is there a way to filter the displayed servers? I tried changing the glob to something more strict but that failed in a weird manner (seemingly random servers not even in the group were returned), plus this would only work if the servers had a consistent naming pattern.

This also breaks if I want to combine things that aren't in the same group.

Let me explain this particular use case so that it's more clear:

I could separate the API servers into a dedicated PRTG group, but that's a heavy handed approach. I'd also have to put the load balancer into that group in order to maintain the data density I'm trying to achieve. This doesn't seem like a very flexible approach to data compositing.

So, I really like the wildcarding, but wish I could apply filtering (this might be user error), but I'd really prefer the host name either always be displayed or be a toggle like the sensor name.

neuralfraud commented 7 years ago

@Liquidmantis I can add an option to the query to force append host name.

Each field can be filtered via regex, so if your hosts have a naming convention, or even if you know individual names, you can do something like:

/prdweb01|prdweb02|prdweb03|prdlb01/

Liquidmantis commented 7 years ago

Adding the host name would be great.

I got the filtering working as you suggested above. The '/' was the key. Without it the results are very bizarre and it displays devices that aren't in the specified group at all.

Liquidmantis commented 7 years ago

@neuralfraud You know, depending on what you're doing once you get in there, it might be nice to have the option to specify a custom label string. In our case the Grafana audience isn't entirely the same as the PRTG audience, and it would be nice to be able to set a "friendlier" display name on the Grafana legend.

neuralfraud commented 7 years ago

@Liquidmantis This is now fixed in release v4.0.1

neuralfraud commented 7 years ago

@Liquidmantis Will consider custom label for 4.0.2 :)

Liquidmantis commented 7 years ago

@neuralfraud Thanks! This is much better.