Guide to setting up Grafana + InfluxDB Metrics

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Influxdb not running? What does netstat -na|grep LISTEN in the jail with influxdb say? What about service influxd status?
 

kbrvfx

Dabbler
Joined
Dec 6, 2020
Messages
28
Influxdb not running? What does netstat -na|grep LISTEN in the jail with influxdb say? What about service influxd status?
netstat -na|grep LISTEN
tcp46 0 0 *.8086 *.* LISTEN tcp46 0 0 127.0.0.1.8088 *.* LISTEN tcp46 0 0 *.3000 *.* LISTEN

service influxd status
influxd is running as pid 84561

Tried changing bind address from ":2003" to ":3000" hoping that it would solve the problem but it still persists.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
3000 is the standard port for Grafana. You cannot run Grafana and Influx on the same port. Grafana - 3000. Influx - 2003. Make sure the Graphite plugin in Influx is enabled:
Code:
[[graphite]]
  enabled = true
  database = "graphite"
  retention-policy = ""
  bind-address = ":2003"
  protocol = "tcp"
  consistency-level = "one"

  separator = "."

  templates = [
    "servers.* .hostname.resource.instance.measurement*",
  ]


If you don't put enabled = true in there, it won't work.
 

kbrvfx

Dabbler
Joined
Dec 6, 2020
Messages
28
3000 is the standard port for Grafana. You cannot run Grafana and Influx on the same port. Grafana - 3000. Influx - 2003. Make sure the Graphite plugin in Influx is enabled:
Code:
[[graphite]]
  enabled = true
  database = "graphite"
  retention-policy = ""
  bind-address = ":2003"
  protocol = "tcp"
  consistency-level = "one"

  separator = "."

  templates = [
    "servers.* .hostname.resource.instance.measurement*",
  ]


If you don't put enabled = true in there, it won't work.
1637330469513.png

This is my current config during my digging for solutions and problem still persists.

Edit: added "s" on servers, saved and restarted influxd, still problem persists.
 
Last edited:

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Now check if influxd is running, check if something is listening on port 2003/tcp. Same commands as above. If both answers are "yes", check the IP address of your jail (ifconfig inside the jail). Check if you used that in the "Reporting" config of your TrueNAS. Try to connect to the jail IP port 2003 with telnet ...
 

kbrvfx

Dabbler
Joined
Dec 6, 2020
Messages
28
Now check if influxd is running, check if something is listening on port 2003/tcp. Same commands as above. If both answers are "yes", check the IP address of your jail (ifconfig inside the jail). Check if you used that in the "Reporting" config of your TrueNAS. Try to connect to the jail IP port 2003 with telnet ...
Rebuilt the entire jail by going through the entire process again (ofc with the config that you suggested for influxd.conf and reporting section filled with the right ip address), still stuck with the same error with write_graphite plugin: Connecting to 192.168.x.13:2003 via tcp failed. The last error was: failed to connect to remote host: Connection refused

While doing the netstat, nothing is listening to port 2003 but only to ports (80876, 8088 and 3000).
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Then influxd is not running or not properly configured. Look for a logfile ...

It really is as simple as that. If influxd is listening on port 2003, that will show up in netstat.
 

kbrvfx

Dabbler
Joined
Dec 6, 2020
Messages
28
Then influxd is not running or not properly configured. Look for a logfile ...

It really is as simple as that. If influxd is listening on port 2003, that will show up in netstat.
Just an update. I misunderstood on the location file of the config that must be tweaked.
Instead of tweaking the influxd.conf file within the grafana jail, I edited the influxd.conf inside the truenas instance.

After tweaking the influxd.conf inside the grafanajail then my grafana could already pull data from TrueNas.

TL;DR - Configured the wrong file due to misunderstanding (file is same name but on TrueNas instance), fixed it by configuring influxd.conf located within the jail. Now everyone is happy.
 

ChrisChros

Patron
Joined
Nov 24, 2018
Messages
218
Hi guys,

does somebody of you know how to update Grafana plugins?
I want to update the Google Sheets plugin from version 1.0.1 to 1.1.2 because it tells me there is an update available. Grafana tells me also how to perform this update with the following command:
Code:
grafana-cli plugins update grafana-googlesheets-datasource

But when I login via CLI and type in the command nothin happens and I get the following output:
Code:
root@Grafana:~ # grafana-cli plugins update grafana-googlesheets-datasource
✔ grafana-googlesheets-datasource is up to date
Please restart Grafana after installing plugins. Refer to Grafana documentationfor instructi


is there another way to update the plugins within Grafana or is this not possible because Grafana is installed as a plugin?

Regards Chris
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
How did you install the plugin? The grafana-googlesheets-datasource, that is. Can't you put an updated version into /var/db/grafana/plugins?
 

ChrisChros

Patron
Joined
Nov 24, 2018
Messages
218
I installed Grafana with the instruction given here. So not the Community plugin via the GUI.
the availability of an update is shown under Configuration / Plugins.
 
Last edited:

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
I asked how you installed the grafana-googlesheets-datasource plugin, not Grafana itself.
 

ChrisChros

Patron
Joined
Nov 24, 2018
Messages
218
as described on the Grafana Homepage with the command:
Code:
grafana-cli plugins install grafana-googlesheets-datasource


Then it downloads Verison 1.0.1. Within the Plugin selection window in Grafana it is listed with version 1.0.1 and the availability of an update to version 1.1.2.

Update:
I looks like the update of the plugin is not supported within freebsd:

Code:
root@Grafana:~ # grafana-cli plugins install grafana-googlesheets-datasource 1.1.2
Error: ✗ grafana-googlesheets-datasource v1.1.2 is not supported on your system(Grafana v8.1.7 freebsd-amd64)
root@Grafana:~ #
 
Last edited:

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
On that page you linked they explicitly state:
Alternatively, you can manually download the .zip file for your architecture below and unpack it into your grafana plugins directory.

The plugin directory is /var/db/grafana/plugins inside your Grafana jail ...
 

ChrisChros

Patron
Joined
Nov 24, 2018
Messages
218
but what is the right one?
linux-amd64? I dont think so, and a freebsd version is not listed.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Ah ... so the version 1.0.1 seems to be platform independent, while the latest is not. And without a release for FreeBSD ... that's probably why the grafana-cli doesn't perform an update, either.

I suggest you contact Grafana Labs about that.
 

jon_2112

Explorer
Joined
Feb 8, 2016
Messages
52
Sorry to bump this thread, but I'm having trouble parsing my temperature data. My TrueNAS instance is reporting temperatures slightly differently from OP, and I'm struggling to understand how to parse the fields in the template to aggregate them.

Instead of:
servers.moneta_local.disktemp.da0.temperature
I have:
servers.mickey_local.disktemp-da0.temperature

How can I format the template for this to work?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Did you activate "Graphite Separate Instances" in System > Reporting?
 

Dravinian

Dabbler
Joined
Jun 30, 2020
Messages
32
I am going to bump an old thread as well....

"*.*.cputemp.* .host.measurement.cpu.field",

Doesn't seem to give me in anything in Influx.

When I do:

select * from cputemp

I get nothing. If I go to Grafana, it doesn't exist there. I renamed it, in case there was a conflict to: cpugraf - same deal.

Is there a command to see whether it is running, or has the template changed in anyway?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Have you tried to check what is there at all with e.g. show series?
 
Top