Code Monkey home page Code Monkey logo

grafana-pnp-datasource's Introduction

PNP Grafana Datasource

A Grafana backend datasource using PNP4Nagios to access RRD files.

Installation

Search for pnp in the Grafana plugins directory or simply use the grafana-cli command:

%> grafana-cli plugins install sni-pnp-datasource

Also OMD-Labs comes with this datasource included, so if you use OMD-Labs, everything is setup already.

Otherwise follow these steps:

%> cd var/grafana/plugins
%> git clone -b release-1.0.7  https://github.com/sni/grafana-pnp-datasource.git
%> restart grafana

Replace release-1.0.7 with the last available release branch.

PNP API

In order to make this datasource work, you need the pnp api. This is a separate project at the moment and will be part of the official pnp in the future. You can fetch the api.php from https://github.com/lingej/pnp-metrics-api and place it in your controler folder.

In a standard PNP setup, you could basically just download the api directly into the controller folder with a simple wget:

wget "https://github.com/lingej/pnp-metrics-api/raw/master/application/controller/api.php" \
     -O /usr/share/pnp4nagios/html/application/controllers/api.php

Adjust the output path to your installation.

Or simply use the PNP fork from https://github.com/ConSol-Monitoring/pnp which has added the api already.

Create Datasource

Add a new datasource and select:

- Type 'PNP'
- Url to pnp, ex.: 'https://localhost/sitename/pnp4nagios'

Example Dashboard

This datasource ships an example dashboard which gets you started and shows the internal PNP statistics.

Queries

Simply select host, service and label in the query editor. Regular expressions are supported in the host and service field by adding slashes like /.*/.

Variables

You may use the following variables in the alias field:

- $tag_host: will be replaced with the hostname
- $tag_service: will be replaced with the service name
- $tag_label: will be replaced with the label
- $tag_perflabel: same as label

All standard variables will also do.

Templating

There is basic templating variable support. There are 3 different querys available:

- $host:    hosts
- $service: services where host = /^$host$/
- $label:   labels where host = /^$host$/ and service = /^$service$/

host variables examples

Development

To test and improve the plugin you can run Grafana instance in Docker using following command (in the source directory of this plugin):

%> make dev

This will start a grafana container and a build watcher which updates the plugin is the dist/ folder.

The dev instance can be accessed at http://localhost:3000

You need to add the datasource manually.

Testing

For testing you can use the demo pnp instance at:

Create Release

How to create a new release:

%> export RELVERSION=1.0.9
%> export GRAFANA_API_KEY=...
%> vi package.json # replace version
%> vi CHANGELOG.md # add changelog entry
%> git commit -am "Release v${RELVERSION}"
%> git tag -a v${RELVERSION} -m "Create release tag v${RELVERSION}"
%> make GRAFANA_API_KEY=${GRAFANA_API_KEY} releasebuild
# create release here https://github.com/sni/grafana-pnp-datasource/releases/new
# submit plugin update here https://grafana.com/orgs/sni/plugins

Changelog

see CHANGELOG.md

grafana-pnp-datasource's People

Contributors

dependabot[bot] avatar sni avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

grafana-pnp-datasource's Issues

Feature request - Hostgroups

Fantastic plugin for Grafana, seriously. The only thing I'd love to see added is support for graphing based on hostgroups instead of hosts. This would allow for building dashboards that are self-maintaining based on Nagios itself rather than having to update the dashboard every time you add/remove a host host from Nagios.

HTTP Error Internal Server Error

Hello,

The datasource part doesn't seem to work either with Proxy or direct connection. I always receive a HTTP Error Internal Server Error response when clicking on 'Save'.

Grafana: 4.4.3
pnp4nagios: 0.6.25
nagios: 4.3.2

Regards,

PNP yaml config file

Hello,

According to this Grafana link -> http://docs.grafana.org/administration/provisioning/#datasources?utm_source=grafana_ds_list , it’s possible now with Grafana version 6.0.1 to manage datasources in Grafana by adding one or more yaml config files in the provisioning/datasources directory. This is what I've tried to do for Grafana-PNP with the following config file but doesn't work and I suppose it's because Grafana-PNP is not presently supported !

config file version

apiVersion: 1
deleteDatasources:

  • name: Test
    orgId: 1
    datasources:
  • name: Test
    type: PNP
    access: direct
    orgId: 1
    url: https://192.168.2.227/pnp4nagios
    withCredentials: true
    isDefault: true
    editable: true

Grafana : 6.0.1
pnp4nagios : 0.6.26
Nagios : 4.3.2

Support Multiple Datapoints?

Does this support metrics will multiple datapoints? I am looking at bringing in some metrics for various plugins which have multiple points stored? (i.e. apache stats for connections etc) and it looks like it only shows the first value in the ds regardless of what is chosen.

Limiting the output of the data from a multitude of hosts into graph

Hi mate, I thought I would ask here, rather than on the API page, as there doesn't seem to be much traffic there, and all the latest commits were done by you anyway.

I am using your pnp-datasource with Grafana pulling data from NagiosXI, and everything is set up great.
However I am neither a Grafana pro, or know much about the API.
The issue I am having is with the output. The API seems to have a defined setup of what you can do, but in my case for example, I am grafing an app response time across 200 nodes. I want to see the top 5 or 10 time taken. I just really don't know how to do it, as I am new to it.

Multi-Value Template Variable not correctly set in Alias

If I use a multi-value template variable $host in a Query Alias (set to host1, host2 and host3), the string in the label of every time series is "{host1,host2,host3}", and not "host1" for the time series corresponding to host1, etc.

As is, I cannot distinguish between hosts in the time series.

Grafana not receiving values

Error when pulling in data to grafana.

Here is a sample of the data available in .rrd files generated by pnp4nagios.
Command used to extract the data : rrdtool fetch Current_Load.rrd AVERAGE -s 1713441475 -e 1713445075

1713441480: 2.0000000000e-02 4.0000000000e-02 0.0000000000e+00
1713441540: 3.7333333333e-02 4.4333333333e-02 2.1666666667e-03
1713441600: 1.0000000000e-01 6.0000000000e-02 1.0000000000e-02
1713441660: 1.0000000000e-01 6.0000000000e-02 1.0000000000e-02
1713441720: 1.0000000000e-01 6.0000000000e-02 1.0000000000e-02
1713441780: 1.0000000000e-01 6.0000000000e-02 1.0000000000e-02
1713441840: 8.4833333333e-02 5.7833333333e-02 7.8333333333e-03
1713441900: 3.0000000000e-02 5.0000000000e-02 0.0000000000e+00
1713441960: 3.0000000000e-02 5.0000000000e-02 0.0000000000e+00
1713442020: 3.0000000000e-02 5.0000000000e-02 0.0000000000e+00
1713442080: 3.0000000000e-02 5.0000000000e-02 0.0000000000e+00
1713442140: 2.5666666667e-02 5.0000000000e-02 0.0000000000e+00
1713442200: 1.0000000000e-02 5.0000000000e-02 0.0000000000e+00
1713442260: 1.0000000000e-02 5.0000000000e-02 0.0000000000e+00
1713442320: 1.0000000000e-02 5.0000000000e-02 0.0000000000e+00
1713442380: 1.0000000000e-02 5.0000000000e-02 0.0000000000e+00
1713442440: 1.8666666667e-02 5.4333333333e-02 2.1666666667e-03
1713442500: 5.0000000000e-02 7.0000000000e-02 1.0000000000e-02
1713442560: 5.0000000000e-02 7.0000000000e-02 1.0000000000e-02
1713442620: 5.0000000000e-02 7.0000000000e-02 1.0000000000e-02
1713442680: 5.0000000000e-02 7.0000000000e-02 1.0000000000e-02
1713442740: 6.9500000000e-02 7.0000000000e-02 1.0000000000e-02
1713442800: 1.4000000000e-01 7.0000000000e-02 1.0000000000e-02
1713442860: 1.4000000000e-01 7.0000000000e-02 1.0000000000e-02
1713442920: 1.4000000000e-01 7.0000000000e-02 1.0000000000e-02
1713442980: 1.4000000000e-01 7.0000000000e-02 1.0000000000e-02
1713443040: 1.2050000000e-01 7.0000000000e-02 1.0000000000e-02
1713443100: 5.0000000000e-02 7.0000000000e-02 1.0000000000e-02
1713443160: 5.0000000000e-02 7.0000000000e-02 1.0000000000e-02
1713443220: 5.0000000000e-02 7.0000000000e-02 1.0000000000e-02
1713443280: 5.0000000000e-02 7.0000000000e-02 1.0000000000e-02
1713443340: 6.9500000000e-02 7.6500000000e-02 1.4333333333e-02
1713443400: 1.4000000000e-01 1.0000000000e-01 3.0000000000e-02
1713443460: 1.4000000000e-01 1.0000000000e-01 3.0000000000e-02
1713443520: 1.4000000000e-01 1.0000000000e-01 3.0000000000e-02
1713443580: 1.4000000000e-01 1.0000000000e-01 3.0000000000e-02
1713443640: 1.3783333333e-01 9.5666666667e-02 2.7833333333e-02
1713443700: 1.3000000000e-01 8.0000000000e-02 2.0000000000e-02
1713443760: 1.3000000000e-01 8.0000000000e-02 2.0000000000e-02
1713443820: 1.3000000000e-01 8.0000000000e-02 2.0000000000e-02
1713443880: 1.3000000000e-01 8.0000000000e-02 2.0000000000e-02
1713443940: 1.3866666667e-01 8.0000000000e-02 2.0000000000e-02
1713444000: 1.7000000000e-01 8.0000000000e-02 2.0000000000e-02
1713444060: 1.7000000000e-01 8.0000000000e-02 2.0000000000e-02

This is the query run from Grafana and the output (truncated).
{
"request": {
"url": "api/datasources/proxy/uid/cdhqub3mm2wowb/index.php/api/metrics",
"method": "POST",
"data": {
"app": "explore",
"timezone": "browser",
"startTime": 1713445074677,
"interval": "2s",
"intervalMs": 2000,
"panelId": 21594,
"targets": [
{
"refId": "A",
"datasource": {
"type": "sni-pnp-datasource",
"uid": "cdhqub3mm2wowb"
},
"host": "localhost",
"service": "Current_Load",
"perflabel": "load1",
"type": "AVERAGE",
"fill": "fill",
"factor": "1",
"alias": ""
}
],
"range": {
"from": "2024-04-18T11:57:54.675Z",
"to": "2024-04-18T12:57:54.675Z",
"raw": {
"from": "now-1h",
"to": "now"
}
},
"requestId": "explore_gnu",
"rangeRaw": {
"from": "now-1h",
"to": "now"
},
"scopedVars": {
"__interval": {
"text": "2s",
"value": "2s"
},
"__interval_ms": {
"text": 2000,
"value": 2000
}
},
"maxDataPoints": 2377,
"liveStreaming": false,
"start": "1713441475",
"end": "1713445075"
},
"hideFromInspector": false
},
"response": {
"targets": [
[
{
"start": 1713441480000,
"end": 1713445080000,
"host": "localhost",
"service": "Current_Load",
"perflabel": "load1",
"type": "AVERAGE",
"datapoints": [
[
0,
1713441480000
],
[
0,
1713441540000
],
[
0,
1713441600000
],
[
0,
1713441660000
],
[
0,
1713441720000
],
[
0,
1713441780000
],
[
0,
1713441840000
],
[
0,
1713441900000
],
[
0,
1713441960000
],
[
0,
1713442020000
],
[
0,
1713442080000
],
[
0,
1713442140000
],
[
0,
1713442200000
],
[
0,
1713442260000
],
[
0,
1713442320000
],

As you can see we are being returned 0 values for some reason. I have looked through all of the logs available and I cannot find anything that would explain the reason for the invalid values. We are running php 8.2 which did cause a number of issues with the api.php file (we corrected the class use issue) and Grafana now states the datasource is valid.

Any pointers would be appreciated.

Datasource "Http Error not found"

I've just installed Grafana and can't get the pnp4nagios Datasource configured.
Grafana is running on a separate Server from Nagios. Both in the same subnet.
Grafana and pnp4nagios Installation have been done as documented.

From the Grafana Servers commandline, curl http://nagiosserver/pnp4nagios/ works correctly (Redirected page). When configuring the Datasource in Grafana, under Http - Access i only get "Server" or "Browser" as options, neither "proxy" nor "direct". Not sure why that's the case.

Grafana Version: 5.3.2
pnp4nagios Version: 0.6.26
Nagios XI Version: 5.5.2

Any help would be highly appreciated.

Edit: Logs say the following:
t=2018-11-08T10:43:20+0100 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/datasources/proxy/3/index.php/api status=404 remote_addr=10.40.1.154 time_ms=10 size=2193 referer=http://10.90.0.73:3000/datasources/edit/3

Special characters in host or service name

Hi,

I'm having issues with a service called "disk /" when calling it directly via url variables.
In Grafana, if I select the service from a dropdown, then everything works fine, because somethings seems to convert "disk /" to "disk__" in url. But if I try to call the service directly, using the icingaweb2 module for grafana" it's not working. Because the module sends the real service name.

Could it be possible, that this module isn't escaping those names correctly for regex matches?

Example of the call:
http://127.0.0.1:3000/render/dashboard-solo/db/icinga2-default-pnp?var-hostname=Icinga2-J1900.lpz.local&var-service=disk%20%2F&var-command=disk&panelId=1&orgId=1&width=640&height=280&theme=light&from=now-6h&to=now

See attached the JSON-Code of the Dashboard I'm using for this IcingaWeb2 Module.
icinga-default-pnp.json.txt

Templating fails with Multi-Value option

Hi!

I introduced a template variable (Type Custom) with three values. Everything is fine when using the variable as single select.

When I try to introduce a dashboard with panel repeat, I change the variable to option "Multi-Value". Now the panel is repeated three times, but no data points are shown any more.

May be due to the necessary plugin hint for formating multiple values?

PNP v1.0.3, Grafana v4.4.3

Best regards, Mathias

using wildcards?

Thanks for making this great plugin
i have been using it for a long time and have found its extremely easy to use and reliable
but i want to do something new and have come stuck.

I have a series of hosts which all start with ABC followed by a number
e.g.
ABC123456

i see that the plugin supports wildcards using regex ( which I openly admit i do not understand)
my understanding is that a regex to catch my hosts would be
ABC\d*
but this does not work
is this possible?

I wanted to do a dashboard with the hosts repeating so i don't need to hardcode each host into the dashboard (there are potentially thousands)

No services listed under host in query editor when running v1.0.4

After upgrade to v1.0.4 the service lists for the hosts is empty.
Queries in graphs created earlier still works as expected, but when trying to change the service on these queries, they show the same issue as on new ones, not listing the services.

Downgrading to v1.0.3 solved the problem.
Running Grafana v4.5.2

Template variables not expanded

After update from Version 1.08 to Version 2.0.0 and also Version 2.0.1 my template doesn't work anymore. I get all hosts but not the services or labels.

I use the querys from the readme.

- $host:    hosts
- $service: services where host = /^$host$/
- $label:   labels where host = /^$host$/ and service = /^$service$/

In the request from Grafana to the pnp4nagios api index.php/api/services I can see the following request.

{"host":"/^$host$/"}

In version 1.0.8 $host will be replaced with the host-name and since Version 2.0.0 not.

'Label' dropdown returns all services, not just for one being filtered on

When selecting a label for a service, it wildcards to all the services, from all hosts, rather than using the Host and Service that I selected in the dropdowns preceding Label. The Query Inspector shows this:

xhrStatus:"complete" request:Object method:"POST" url:"api/datasources/proxy/2/index.php/api/labels/" data:Object host:"/.*/" service:"/.*/" response:Object labels:Array[275]

Using Grafana 4.6.2 and the latest version of the plugin in the grafana repos.

Compatibility with pnp4nagios 0.14.4

Hi,
First of all, congratulations for the great work.
I created an alternative version of the pnp4nagios api to integrate older versions of pnp4nagios (0.14.4) with grafana-pnp-datasource.
The ideia was to use the api with the default CentOS based Nagios VM without any additional installations and also make it compatible with older versions of Nagios that are already up (upgrade the rrdtool might not be a good ideia).
The code is in my github repository:
pnp4nagios

I'm sharing the api here, so other people can use it too.
If you are interested or have any doubts, ideas or just a feedback, please contact me.

Hugs

Access thresholds

Access to warning/critical threshold and maybe also min/max values would be wonderful.

Problem Grafana

I started using Grafana and i have problem with connect nagios to grafana. I Install Nagios, PNP4Nagios and Grafana in one sever as here https://gitlab.com/ska19/nagiosbundle
When i loggin to grafana i see PNP, i put there URL: http://localhost/pnp4nagios and i have in the screen something like: HTTP Error Internal Server Error
In /var/log/grafana/grafana.log i have: t=2020-05-13T10:57:41+0200 lvl=eror msg=“Request Completed” logger=context userId=1 orgId=1 uname=admin method=GET path=/api/datasources/proxy/1/index.php/api status=500 remote_addr=192.168.1.106 time_ms=7 size=2256 referer=http://192.168.1.113:3000/datasources/edit/1/

image

When i try make:
URL:http://localhost/pnp4nagios
Acces: Browser
Check Basic Auth and With Credentials
Its seems ok, but i dont have nothing here:

image

Nagios XI

Hi,

Do you have any idea where we would install the api controller on an XI installation. Is it even possible to use this datasource with a Nagios XI installation?

Different values from Perfdata and grafdata

Got the following performance date from a client trough nagios and check_wmi_plus.

Status Information:
OK (Sample Period 180 sec) - Number of Interfaces=1. Interface Details - OK -
Interface:Embedded FlexibleLOM 1 Port 1,
IP Address: ([IPADRESS_V4],[IPADDRESS_V6]), MAC Address [MACADDRESS], Speed:10Gbit/s, DHCPEnabled=False,
Byte Send Rate=1.745MB/sec (Utilisation=0.14%),
Byte Receive Rate=115.701KB/sec(Utilisation=0.01%) Packet Send Rate=1.271Kpacket/sec,
Packet Receive Rate=372packet/sec,
Output Queue Length=0,
Packets Received Errors=0

Performance Data:
'Embedded FlexibleLOM 1 Port 1 BytesSentPersec'=1744913;
'Embedded FlexibleLOM 1 Port 1 Send Utilisation'=0.14%;
'Embedded FlexibleLOM 1 Port 1 BytesReceivedPersec'=115701;
'Embedded FlexibleLOM 1 Port 1 Receive Utilisation'=0.01%;
'Embedded FlexibleLOM 1 Port 1 PacketsSentPersec'=1271;
'Embedded FlexibleLOM 1 Port 1 PacketsReceivedPersec'=372;
'Embedded FlexibleLOM 1 Port 1 OutputQueueLength'=0;
'Embedded FlexibleLOM 1 Port 1 PacketsReceivedErrors'=0;

From the perfdata we see there a difference between send and receive, the same difference is see in the pnp4nagios plugin.

In Grafana the values are the same :-/ or do i miss something?

grafana

Thanks Cocoon

Probably wrong API URL

Dear Maintainers of this Repo,

shouldn't it be /index.php/api/labels rather than /index.php/api/label?

return lastValueFrom(this.request('POST', '/index.php/api/label', query_params)).then((response) => {

When I try to access (in browser, GET) /index.php/api/label, I get an empty response.

When I try to access (in browser, GET) /index.php/api/labels, I get the error message, that I didn't provide POST-data (containing search parameters).

Calling /index.php/api/labels behaves the same like /index.php/api/services and /index.php/api/hosts

Thanks for review

Kind Regards

Gregor

Cant add graph if host is down/graph stops working if host goes down

Hi,
I have multiple host data per graph and if one host goes down graph stops working (no data).
If I manually remove that host from graph it wont work. I have to duplicate graph without offline host and then it will work.

Is there any work around so graphs will work if some hosts are down?
Services and hosts data is passive.

Grafana complains about duplicate id because of dist/src/plugin.json

This plugin seems to have an identical problem to the one suffered once by JSON datasource: grafana/simple-json-datasource#38

At Grafana restart, it complains

Jan 10 09:00:54 localhost grafana-xxl[971]: t=2018-01-10T09:00:54+0000 lvl=eror msg="Plugins: Failed to load plugin json file: /grafana-plugins/sni-pnp-datasource/dist/src/plugin.json,  err: Plugin with same id already exists"

The solution is straightforward and probably identical to grafana/simple-json-datasource@b4d9552, ie. removing dist/src from Gruntfile.

Grafana v7.3.1 (6668161a88

today after update to grafana v7.3.1 (6668161a88) all my data error:

PNP plugin failed
Error: Unexpected token '<' Evaluating http://*********/public/plugins/sni-pnp-datasource/module.js Loading plugins/sni-pnp-datasource/module

please fix it 👍

Feature Request: Ability to use regex or wildcards on "Label" option

Hiya,

We have quite a few graphs where we have many labels against a given service (table size within a database for example). pnp4nagios graphs all these on 1 graph (albeit with colour-issues etc), however there are situations where we'd like to be able to plot them on the same grafana graph without having to duplicate the row for each one.

A simple example we have here is Check Disk:
image

Happy to submit a PR if you can point me in the general direction of where that would live as I couldn't really find it

Can't connect to pnp4nagios - empty alert-body

Hey,
I am using Grafana (4.6.3) and some how can not connect to pnp4nagios (0.6.22-3.el7)
image
As you can see error alert-body in empty.

I tried to look into grafana log for any information but without any results.

From grafana host, wget works correctly:
image

In additional curl to PNP api works fine:
image

How can I debug that more?

Authentication with check-mk-raw

I am trying to use this datasource in a standalone Grafana installation (version 7.0.3) and am trying to get data out of a server that is running check-mk-raw version 1.6.0p7.
I have installed the pnp4nagios api script on the check_mk server and I was able to get data out of it using curl, but the only way I've been able to get it to work is to use cookies with a URL that looks like this:
https://checkmk.site.com/mysite/check_mk/login.py?_origtarget=/mysite/pnp4nagios/index.php/api/hosts&_username=grafana-ciarc&_password=mypassword&_login=1

After getting the cookie I can use the normal URL to get results from the API. Is there a way I can tell this datasource how to get and use the cookie? Or is there some other setting that I'm missing?

Pnp4Nagios doe not work with PHP 8

We just migrated to Debian Bookworm which comes with PHP 8
Unfortunately, Pnp4Nagios stopped to work, and Grafana could not fetch data anymore from it.

If I understand well, The Kohana Framework used by PNp4Nagios is not supported in PHP 8.
Do I understand well ?
Is there something to do on your Grafana plugin side ?

We use a CheckMK RAW version on which we haved maintained Pnp4Nagios WEB interface (with difficulties as they decided to delete the WEB part from OMD) sot that Grafana plugin still works.
The CheckMK plugin for Grafana does not work with host variables (Checkmk/grafana-checkmk-datasource#247),
So for the moment, we are stucked.

Cant Calculate % DISK or SWAP Free / Used with Native Nagios Plugin, PNP and Grafana

Hi,
i've a problem to graph % swap and another parameter example disk with Grafana and PNP Datasource.
The Native Plugin check_swap in the perfdata on pnp4Nagios report this parameter:
For Disk:
<NAGIOS_SERVICEPERFDATA>/=28222MiB;107262;120670;0;134078</NAGIOS_SERVICEPERFDATA>
For Swap:
<NAGIOS_SERVICEPERFDATA>swap=7610MB;403;80;0;8063</NAGIOS_SERVICEPERFDATA>

This Value are in order with ; separator
label=VALUE;WARNING;CRITICAL;0;TOTAL_SIZE

When i try to create a graph i show in label swap or disk but in type i show only AVAREGE,MIN,MAX,WARNING AND CRITICAL.

would also need to select the "TOTAL_SIZE" value in the type field in order to calculate the % of use

Can you help me?

In attach the screenshot about this "ISSUE"

GrafanaTypeSelection
ExampleStatusDisk

I Used:
Red Hat Enterprise Linux release 8.6
Nagios® Core™ 4.4.7
PNP4Nagios version pnp-0.6.26
sni-pnp-datasource 1.0.8 and Plugin version 9.1.6
Grafana 9.1.6

Feature request: Grafana variables in wildcard search

Hi

Apologies if this is already possible, what we are after after is being able to include a grafana variable in the Host search , adding to the existing wildcard search functionality.

At the moment i can choose all app servers eg /.*app.*/ or filter a particular env with this wildcard search

What we would like is to be able to refer to a custom grafana variable in this host search.

EG lets call the var env, with the values tsa,tsb,tsc

A host search of /^$env$.*app.*$/ (or similar) that would return all the app servers for the selected dropdown eg. tsa-app* servers.

This would allow for us to have one overview dashboard instead of separate dashboards for each environment. If there's already a cunning way to do this that'd be great too.

2.0.0 -> "Plugin disabled"

After installing 2.0.0:

"Plugin disabled
Grafana Labs checks each plugin to verify that it has a valid digital signature. While doing this, we discovered that the content of this plugin does not match its signature. We can not guarantee the trustworthy of this plugin and have therefore disabled it. We recommend you to reinstall the plugin to make sure you are running a verified version of this plugin.

Please contact your server administrator to get this resolved."

Looks like signing is required https://grafana.com/docs/grafana/latest/developers/plugins/sign-a-plugin/

No Datapoints in Graph with multiple Queries if first Query has none

If the first Query in a Graph with multiple Queries returns no data points, the plot shows "no data points", even if subsequent queries return data.

My use case is a graph in a templated dashboard, where i've got a set of queries configured which may not all be defined for a host.

I suspect that the response data may not be correctly parsed on the Grafana side. If I configure two queries (one empty and one not) and look at the query inspector, i see:

Empty one last:
response: Object { targets: Array[1]: [0: Array[1]: [0: Object: {...}]]}
Empty one first:
response: Object { targets: Object: {1: Array[1]: [0: Object: {...}]}}

Plugin with non-OMD Grafana

We installed a new Grafana instance (Docker latest image) as we wanted to have current Version running. So we aren't running with the omd Grafana but on the same physical host.

We can add the datasource with:

  • an grafana user similar to a nagios user
  • direct
  • an absolute url (even tried with ip not dns)
  • "with credentials"

and it's a success. But then in the dashboards, no data is fetched. In the browser console i see recurring accesses to login.cgi and 302 http codes. Also i see these log entries in the Apache Log of the nagios instance.

We tried other datasource configs but none worked. Direct and Basic Auth always says "Unknown Error" and Proxy always states "Bad Gateway".

Add dashboard variable

Hey!

First of all thanks for the plugin :)
I have a question, how can I add a variable in the grafana dashboard, every time I try, It says No data sources found

I want to add a variable matching different hosts.

image

Could you help me? :)

Thanks,
Berta

Direct links to host and service

Hi,

Not an issue but a question. Is is possible to direct link to a graph, if so how? I guess something like histou is used for which I have not yet tried. Does histou work with grafana-pnp-datasource as well?

Sorry for maybe a stupid question but new to Grafana as well.

Regards, Bjorn

Datasource selects incorrect RRD file when multiple labels are present.

I have encountered an issue when using the datasource on a host check that has multiple labels.

On the Nagios server we have a check with the following rrd files, it seems that regardless of what label we select that the 5m rrd file is always used.

[jonesn@xxxx-xxxxxxx1 xxxxx-xxxxxx01]$ ll CPU*
-rw-rw-r--. 1 nagios nagios 384952 Aug  9 16:02 CPU_total_1m.rrd
-rw-rw-r--. 1 nagios nagios 384952 Aug  9 16:02 CPU_total_30s.rrd
-rw-rw-r--. 1 nagios nagios 384952 Aug  9 16:02 CPU_total_5m.rrd
-rw-rw-r--. 1 nagios nagios   3244 Aug  9 16:02 CPU.xml

The panel is configured as below, in this case we would like to select the 1m avg performance data:

pnp_datasorce_files

pnp_datasorce_files2

When I did an rrddump of the rrd files to XML I noticed that it looked like the 5m avg (at 1 minute tick interval) version of the file was being used by the datasource regardless of the label selected.

XML Dump file lines:

1 minute file (CPU_total_1m.rrd)

			<!-- 2017-08-08 19:19:00 NZST / 1502176740 --> <row><v> 1.8333333333e-01 </v></row>
			<!-- 2017-08-08 19:20:00 NZST / 1502176800 --> <row><v> 1.0000000000e+00 </v></row>
			<!-- 2017-08-08 19:21:00 NZST / 1502176860 --> <row><v> 1.0000000000e+00 </v></row>
			<!-- 2017-08-08 19:22:00 NZST / 1502176920 --> <row><v> 1.3666666667e+00 </v></row>
			<!-- 2017-08-08 19:23:00 NZST / 1502176980 --> <row><v> 1.7850000000e+01 </v></row>
			<!-- 2017-08-08 19:24:00 NZST / 1502177040 --> <row><v> 8.2900000000e+01 </v></row>
			<!-- 2017-08-08 19:25:00 NZST / 1502177100 --> <row><v> 6.3883333333e+01 </v></row>
			<!-- 2017-08-08 19:26:00 NZST / 1502177160 --> <row><v> 8.1666666667e-01 </v></row>
			<!-- 2017-08-08 19:27:00 NZST / 1502177220 --> <row><v> 1.8333333333e-01 </v></row>
			<!-- 2017-08-08 19:28:00 NZST / 1502177280 --> <row><v> 1.0000000000e+00 </v></row>
			<!-- 2017-08-08 19:29:00 NZST / 1502177340 --> <row><v> 4.4833333333e+00 </v></row>
			<!-- 2017-08-08 19:30:00 NZST / 1502177400 --> <row><v> 1.6516666667e+01 </v></row>
			<!-- 2017-08-08 19:31:00 NZST / 1502177460 --> <row><v> 8.1666666667e-01 </v></row>
			<!-- 2017-08-08 19:32:00 NZST / 1502177520 --> <row><v> 0.0000000000e+00 </v></row>

5 minute file (CPU_total_5m.rrd)

			<!-- 2017-08-08 19:19:00 NZST / 1502176740 --> <row><v> 0.0000000000e+00 </v></row>
			<!-- 2017-08-08 19:20:00 NZST / 1502176800 --> <row><v> 0.0000000000e+00 </v></row>
			<!-- 2017-08-08 19:21:00 NZST / 1502176860 --> <row><v> 0.0000000000e+00 </v></row>
			<!-- 2017-08-08 19:22:00 NZST / 1502176920 --> <row><v> 1.8333333333e-01 </v></row>
			<!-- 2017-08-08 19:23:00 NZST / 1502176980 --> <row><v> 2.1000000000e+00 </v></row>
			<!-- 2017-08-08 19:24:00 NZST / 1502177040 --> <row><v> 1.0666666667e+01 </v></row>
			<!-- 2017-08-08 19:25:00 NZST / 1502177100 --> <row><v> 2.7916666667e+01 </v></row>
			<!-- 2017-08-08 19:26:00 NZST / 1502177160 --> <row><v> 3.2000000000e+01 </v></row>
			<!-- 2017-08-08 19:27:00 NZST / 1502177220 --> <row><v> 3.2000000000e+01 </v></row>
			<!-- 2017-08-08 19:28:00 NZST / 1502177280 --> <row><v> 3.0716666667e+01 </v></row>
			<!-- 2017-08-08 19:29:00 NZST / 1502177340 --> <row><v> 2.2250000000e+01 </v></row>
			<!-- 2017-08-08 19:30:00 NZST / 1502177400 --> <row><v> 8.9000000000e+00 </v></row>
			<!-- 2017-08-08 19:31:00 NZST / 1502177460 --> <row><v> 4.0000000000e+00 </v></row>
			<!-- 2017-08-08 19:32:00 NZST / 1502177520 --> <row><v> 4.1833333333e+00 </v></row>
			<!-- 2017-08-08 19:33:00 NZST / 1502177580 --> <row><v> 4.8166666667e+00 </v></row>

Problem in configuring the pnp plugin

Hi i want to read or import a rrd file into grafana. So i read about the pnp plugin. I followed the step to install it
grafana-cli plugins install sni-pnp-datasource
But can i have details on how to configure this data source and then read the rrd file into grafana using pnp? what should eb the url and the steps ahead?

multiple labels uses same data

First of all, thanks for this plugin.

We facing one problem when we try to create a graph for disk usage.

grafana_label

As shown in the picture above you can see that we select different labels, but the data values remains the same.

Our perfdata looks like this:

/=2123MB;4343;4599;0;5110 /dev=0MB;1599;1693;0;1882 /run=200MB;1609;1703;0;1893 /sys/fs/cgroup=0MB;1609;1703;0;1893 /boot=232MB;336;356;0;396 /var=7179MB;17399;18423;0;20470 /tmp=32MB;1732;1834;0;2038 /home=1158MB;4348;4604;0;5116 /var/lib/mysql=1477MB;8695;9207;0;10230 /home/perconabackup=1183MB;8695;9207;0;10230 /var/www=61896MB;87031;92151;0;102390

Is there something wrong with the format of our perfdata?

Best regards

facenn

[Request][Feature] Host and Service States

Is there a way to get the Host- and Service-States into Grafana? I know the Plugin is just reading the perfdata from the rrd files and the states aren't there but can you imaging a way?

As a sidenote: thank you a million times for this plugin! Nagflux is a great idea but we also need pnp/rrd and booth solutions combined produces so many problems. This plugin just solves our need for pretty and easy to change graphs and just keeping rrd in the backend.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.