Telegraf / InfluxDB



  • I am trying to get Telegraf to send data to an InfluxDB instance. It was working until I rebooted the firewall, and now I can't make it work no matter what I try. I verified that telegraf is running, and also double checked telegraf.conf for the correct IP of the InfluxDB instance. It just doesnt seem to be sending any data out of pfsense. My next step will be to run wireshark on the network to see where the packets are stopping.

    Any other ideas?



  • Check the log file.

    
    tail -f /var/log/telegraf.log
    2017/02/25 13:25:50 E! Database creation failed: Post http://192.168.86.30:8086/query?db=&q=CREATE+DATABASE+%22telegraf%22: dial tcp 192.168.86.30:8086: connect: host is down
    2017/02/25 13:25:50 E! Error writing to output [influxdb]: Could not write to any InfluxDB server in cluster
    2017/02/25 13:26:00 E! Database creation failed: Post http://192.168.86.30:8086/query?db=&q=CREATE+DATABASE+%22telegraf%22: dial tcp 192.168.86.30:8086: connect: host is down
    
    

    When I bounce my influxdb, I get error messages in the log.

    Most likely, you have a config issue and it should show up in the telegraf log.



  • I just checked the telegraf log, and below is the repeating log entry.  I verified the IP address of the InfluxDB server, and I am not using a username/password yet.

    2017/02/21 20:33:38 E! Database creation failed: Post http://localhost:8086/query?db=&q=CREATE+DATABASE+%22telegraf%22: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
    2017/02/21 20:33:55 E! Database creation failed: Post http://localhost:8086/query?db=&q=CREATE+DATABASE+%22telegraf%22: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
    2017/02/21 20:33:55 E! Error writing to output [influxdb]: Could not write to any InfluxDB server in cluster
    

    The telegraf.conf seems fairly straightforward for at least basic use, so I  am pretty sure it is ok. On another note, I had this working last week, and was graphing simple data in Grafana, until I rebooted pfsense, then all data flow stopped. I cant figure out what would have changed upon reboot to break this.



  • It looks like you have the default localhost config based on the error.

    What does your urls line look like:

    
      # urls = ["udp://localhost:8089"] # UDP endpoint example
      urls = ["http://192.168.86.30:8086"] # required
    
    

    Mine writes to the 192 address above where my influxdb is.



  • I may have posted the wrong log. I have been testing this various ways, and I think I wasnt thinking clearly.  ::) I have been trying everything I can think of to remedy this. Below is the current config and resulting log entries.

    [[outputs.influxdb]]
      ## The full HTTP or UDP endpoint URL for your InfluxDB instance.
      ## Multiple urls can be specified as part of the same cluster,
      ## this means that only ONE of the urls will be written to each interval.
      # urls = ["udp://10.20.0.232:8089"] # UDP endpoint example
      urls = ["http://10.20.0.55:8086"] # required
      ## The target database for metrics (telegraf will create it if not exists).
      database = "telegraf" # required
    
    
    2017/02/28 17:09:45 E! Database creation failed: Post http://10.20.0.55:8086/query?db=&q=CREATE+DATABASE+%22telegraf%22: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
    2017/02/28 17:09:45 E! Error writing to output [influxdb]: Could not write to any InfluxDB server in cluster
    


  • Are you able to hit:

    ttp://10.20.0.55:8083

    That's normally your admin port.

    You can enter in 'show databases'

    and even try to create the database.

    I have no authentication on my influxdb since it's all internal.