rhodesman / teslaPowerDash

GNU General Public License v3.0
85 stars 11 forks source link

InfluxDB database is not populating #7

Closed Nakatomi2010 closed 3 years ago

Nakatomi2010 commented 4 years ago

I've followed the readme to the best of my abilities, confirmed that the database is created, and the settings are correct, however, the database is not populating with data. Bit stumped on where I've gone wrong there.

rhodesman commented 4 years ago

Did you verify that Telegraf is running and that the settings in there are correct? Could you post the http and influxdb sections of your telegraf config file?

Nakatomi2010 commented 4 years ago

InfluxDB section:

[[outputs.influxdb]]
  ## The full HTTP or UDP URL for your InfluxDB instance.
  ##
  ## Multiple URLs can be specified for a single cluster, only ONE of the
  ## urls will be written to each interval.
  #  urls = ["unix:///var/run/influxdb.sock"]
  # urls = ["udp://127.0.0.1:8089"]
  urls = ["http://<IP>:8086"]

  ## The target database for metrics; will be created as needed.
  ## For UDP url endpoint database needs to be configured on server side.
  database = "powerData"

  ## The value of this tag will be used to determine the database.  If this
  ## tag is not set the 'database' option is used as the default.
  # database_tag = ""

  ## If true, the database tag will not be added to the metric.
  # exclude_database_tag = false

  ## If true, no CREATE DATABASE queries will be sent.  Set to true when using
  ## Telegraf with a user without permissions to create databases or when the
  ## database already exists.
  skip_database_creation = false

  ## Name of existing retention policy to write to.  Empty string writes to
  ## the default retention policy.  Only takes effect when using HTTP.
  # retention_policy = ""

  ## Write consistency (clusters only), can be: "any", "one", "quorum", "all".
  ## Only takes effect when using HTTP.
  # write_consistency = "any"

  ## Timeout for HTTP messages.
  # timeout = "5s"
  ## HTTP Basic Auth
  # username = "telegraf"
  # password = "metricsmetricsmetricsmetrics"

  ## HTTP User-Agent
  # user_agent = "telegraf"

  ## UDP payload size is the maximum packet size to send.
  # udp_payload = "512B"

  ## Optional TLS Config for use on HTTP connections.
  # tls_ca = "/etc/telegraf/ca.pem"
  # tls_cert = "/etc/telegraf/cert.pem"
  # tls_key = "/etc/telegraf/key.pem"
  ## Use TLS but skip chain & host verification
  # insecure_skip_verify = false

  ## HTTP Proxy override, if unset values the standard proxy environment
  ## variables are consulted to determine which proxy, if any, should be used.
  # http_proxy = "http://corporate.proxy:3128"

  ## Additional HTTP headers
  # http_headers = {"X-Special-Header" = "Special-Value"}

  ## HTTP Content-Encoding for write request body, can be set to "gzip" to
  ## compress body or "identity" to apply no encoding.
  # content_encoding = "identity"

  ## When true, Telegraf will output unsigned integers as unsigned values,
  ## i.e.: "42u".  You will need a version of InfluxDB supporting unsigned
  ## integer values.  Enabling this option will result in field type errors if
  ## existing data has been written.
  # influx_uint_support = false

`

Inputs_http:


`# # Read formatted metrics from one or more HTTP endpoints
 [[inputs.http]]
#   ## One or more URLs from which to read formatted metrics
   urls = [
     "https://<IP>/api/meters/agregates",
     "https://<IP>/api/system_status/soe",
     "http://<Different IP>:3301/api/tesla/<Mine!>/energy_sites/<Nope!>/live_status"
   ]
#
#   ## HTTP method
 method = "GET"
#
#   ## Optional HTTP headers
#   # headers = {"X-Special-Header" = "Special-Value"}
#
#   ## Optional HTTP Basic Auth Credentials
#   # username = "username"
#   # password = "pa$$word"
#
#   ## HTTP entity-body to send with POST/PUT requests.
#   # body = ""
#
#   ## HTTP Content-Encoding for write request body, can be set to "gzip" to
#   ## compress body or "identity" to apply no encoding.
#   # content_encoding = "identity"
#
#   ## Optional TLS Config
#   # tls_ca = "/etc/telegraf/ca.pem"
#   # tls_cert = "/etc/telegraf/cert.pem"
#   # tls_key = "/etc/telegraf/key.pem"
#   ## Use TLS but skip chain & host verification
 insecure_skip_verify = true
#
#   ## Amount of time allowed to complete the HTTP request
 timeout = "5s"
#
#   ## Data format to consume.
#   ## Each data format has its own unique set of configuration options, read
#   ## more about them here:
#   ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md
 data_format = "json"
`
rhodesman commented 4 years ago

Take a look at the influxDB.conf file under the [http] settings. See if you have auth-enabled = true or false and that the bind address is the IP address of the server (not localhost):

[http]
  # Determines whether HTTP endpoint is enabled.
  enabled = true

  # Determines whether the Flux query endpoint is enabled.
  # flux-enabled = false

  # Determines whether the Flux query logging is enabled.
  # flux-log-enabled = false

  # The bind address used by the HTTP service.
  bind-address = "10.0.10.2:8086"

  # Determines whether user authentication is enabled over HTTP/HTTPS.
  auth-enabled = false

  # The default realm sent back when issuing a basic auth challenge.
  # realm = "InfluxDB"

  # Determines whether HTTP request logging is enabled.
  log-enabled = true

You can also verify Influx is running by going to: http://{your IP address}:8086/debug/pprof

Nakatomi2010 commented 4 years ago

HTTP section of InfluxDB.conf:

[http]
  # Determines whether HTTP endpoint is enabled.
 enabled = true

  # The bind address used by the HTTP service.
 bind-address = "<mine>:8086"

  # Determines whether user authentication is enabled over HTTP/HTTPS.
 auth-enabled = false

  # The default realm sent back when issuing a basic auth challenge.
  # realm = "InfluxDB"

  # Determines whether HTTP request logging is enabled.
 log-enabled = true

Honestly it's also looking like there's NPM issues. I've got NodeJS 10 installed, and when I do NPM install it complains that NodeJS 10 is installed and that it only supports NodeJS 6, 7,8 and 9.