Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grafana 4.0 issue with singlestat text not showing a text metric from Zabbix #325

Closed
1 task done
jmaitrehenry opened this issue Dec 27, 2016 · 13 comments
Closed
1 task done

Comments

@jmaitrehenry
Copy link

I'm submitting a ...

  • Bug report

Grafana version : Version 4.0.2 (commit: v4.0.2)
Grafana-zabbix version: 3.2.0
Zabbix version: 3.2.1

I add a SingleSat Panel with a text metric on Zabbix, if I use the General - Host Name metric, it works as expected, if I use some other text metric, it show no result.

I made a Table panel with the same metric as the SingleStat and with the same "aggregation" (current):
screen shot 2016-12-27 at 4 54 49 pm
The table works but not the singlestat, I don't know if it's a bug with the Zabbix plugin or the Singlestat plugin.

One item from the chrome console: {itemid: "25528", clock: "1482875218", value: "petalmd", ns: "734248728"}

Thanks!

@alexanderzobnin
Copy link
Collaborator

Looks strange, it works on my public instance: http://play.grafana-zabbix.org/dashboard/db/text-metrics (Grafana 4.0.2)

@alexanderzobnin
Copy link
Collaborator

Can you show your SingleStat query?

@jmaitrehenry
Copy link
Author

Request payload:

{"jsonrpc":"2.0","method":"history.get","params":{"output":"extend","history":"4","itemids":["25528"],"sortfield":"clock","sortorder":"ASC","time_from":1483465926,"time_till":1483469526},"id":1,"auth":"xxxxx"}

The singlestats json:

{
  "cacheTimeout": null,
  "colorBackground": false,
  "colorValue": false,
  "colors": [
    "rgba(245, 54, 54, 0.9)",
    "rgba(237, 129, 40, 0.89)",
    "rgba(50, 172, 45, 0.97)"
  ],
  "datasource": "Zabbix",
  "editable": true,
  "error": false,
  "format": "none",
  "gauge": {
    "maxValue": 100,
    "minValue": 0,
    "show": false,
    "thresholdLabels": false,
    "thresholdMarkers": true
  },
  "id": 8,
  "interval": null,
  "links": [],
  "mappingType": 1,
  "mappingTypes": [
    {
      "name": "value to text",
      "value": 1
    },
    {
      "name": "range to text",
      "value": 2
    }
  ],
  "maxDataPoints": 100,
  "nullPointMode": "connected",
  "nullText": null,
  "postfix": "",
  "postfixFontSize": "50%",
  "prefix": "",
  "prefixFontSize": "50%",
  "rangeMaps": [
    {
      "from": "null",
      "text": "N/A",
      "to": "null"
    }
  ],
  "span": 2,
  "sparkline": {
    "fillColor": "rgba(31, 118, 189, 0.18)",
    "full": false,
    "lineColor": "rgb(31, 120, 193)",
    "show": false
  },
  "targets": [
    {
      "alias": "Cluster name",
      "application": {
        "filter": "Elasticsearch",
        "name": "Elasticsearch"
      },
      "downsampleFunction": {
        "name": "avg",
        "value": "avg"
      },
      "errors": {},
      "functions": [],
      "group": {
        "filter": "ElasticSearch",
        "groupid": "11",
        "name": "ElasticSearch"
      },
      "hide": false,
      "host": {
        "filter": "$Server",
        "name": "$Server",
        "templated": true
      },
      "item": {
        "filter": "Cluster name",
        "name": "Cluster name"
      },
      "mode": 2,
      "options": {
        "showDisabledItems": false
      },
      "refId": "A",
      "useCaptureGroups": false
    }
  ],
  "thresholds": "",
  "title": "Cluster name",
  "type": "singlestat",
  "valueFontSize": "80%",
  "valueMaps": [],
  "valueName": "current"
}

@alexanderzobnin
Copy link
Collaborator

Hm, have no ideas...

@jars99
Copy link

jars99 commented Mar 28, 2017

I am having this issue as well. I even upgraded grafana from 4.0.2 to 4.2, and am still seeing it. Just like the original poster, it works with a table, but not on a singlestat. The zabbix plugin version is 3.3.0.

@jars99
Copy link

jars99 commented Mar 28, 2017

Ah - I just found a workaround. I had "max data points" set to 1. If I delete that, then the text shows up correctly.
I discovered this when I set my "max data points" for the table to 5, and suddenly it started saying "NaN" as the result.

@alexanderzobnin
Copy link
Collaborator

That's really strange. I'll try to find a reason.

@tatianab85
Copy link

Hi,
I had the same exact problem, if I make a Table panel with the same metric (text) as the SingleStat it shows the system name and description but it wasn't working with single stats, it showed NaN, after trying differents values for "max data points" I found a solution setting it up to 1000, leave it in auto didn't work.

@fabio-santos-movile
Copy link

Same here... some items works as well, but other not.
the item type is character, but result return null.

@alexanderzobnin
Copy link
Collaborator

I should remove post processing (max data points - related) from text metrics. Because if number of points > max data points, plugin tries to reduce it using average and for strings, it returns NaN, of course.

@zakthan
Copy link

zakthan commented Nov 28, 2018

Hi I have the exact problem for plugin 3.8.1.
zabbix 2.4 and grafana 4.3.0
I have an item which returns a string at zabbix.
When I create a singlestat at grafana I get N/A

@alexanderzobnin
Copy link
Collaborator

@zakthan N/A isn't the same as NaN. So I think, it's a different issue.

@zakthan
Copy link

zakthan commented Dec 4, 2018

Hi Alexander,
upgraded to grafana 5.3.4 and now works fine.
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants