Skip to content

Instantly share code, notes, and snippets.

@toff63
Last active March 21, 2016 21:36
Show Gist options
  • Select an option

  • Save toff63/9f3b9f82382dcde8fafb to your computer and use it in GitHub Desktop.

Select an option

Save toff63/9f3b9f82382dcde8fafb to your computer and use it in GitHub Desktop.

Revisions

  1. toff63 revised this gist Mar 21, 2016. 2 changed files with 95 additions and 0 deletions.
    95 changes: 95 additions & 0 deletions influxdb.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,95 @@
    reporting-disabled = false

    [meta]
    enabled = true

    dir = "/var/lib/influxdb/meta"

    bind-address = ":8088"
    retention-autocreate = true
    election-timeout = "1s"
    heartbeat-timeout = "1s"
    leader-lease-timeout = "500ms"
    commit-timeout = "50ms"
    cluster-tracing = false


    [data]
    enabled = true

    dir = "/var/lib/influxdb/data"
    max-wal-size = 104857600 # Maximum size the WAL can reach before a flush. Defaults to 100MB.
    wal-flush-interval = "10m" # Maximum time data can sit in WAL before a flush.
    wal-partition-flush-delay = "2s" # The delay time between each WAL partition being flushed.

    wal-dir = "/var/lib/influxdb/wal"
    wal-logging-enabled = true
    data-logging-enabled = true

    [hinted-handoff]
    enabled = true
    dir = "/var/lib/influxdb/hh"
    max-size = 1073741824
    max-age = "168h"
    retry-rate-limit = 0

    retry-interval = "1s"
    retry-max-interval = "1m"
    purge-interval = "1h"

    [cluster]
    shard-writer-timeout = "5s" # The time within which a remote shard must respond to a write request.
    write-timeout = "10s" # The time within which a write request must complete on the cluster.

    [retention]
    enabled = true
    check-interval = "30m"


    [shard-precreation]
    enabled = true
    check-interval = "10m"
    advance-period = "30m"


    [monitor]
    store-enabled = true # Whether to record statistics internally.
    store-database = "_internal" # The destination database for recorded statistics
    store-interval = "10s" # The interval at which to record statistics


    [admin]
    enabled = true
    bind-address = ":8083"
    https-enabled = false
    https-certificate = "/etc/ssl/influxdb.pem"


    [http]
    enabled = true
    bind-address = ":8086"
    auth-enabled = false
    log-enabled = true
    write-tracing = false
    pprof-enabled = false
    https-enabled = false
    https-certificate = "/etc/ssl/influxdb.pem"

    [[graphite]]
    enabled = false

    [collectd]
    enabled = true
    bind-address = "localhost:25826"
    database = "collectd_db"
    typesdb = "/usr/share/collectd/types.db"

    [opentsdb]
    enabled = false

    [[udp]]
    enabled = false

    [continuous_queries]
    log-enabled = true
    enabled = true
  2. toff63 revised this gist Mar 21, 2016. 1 changed file with 62 additions and 0 deletions.
    62 changes: 62 additions & 0 deletions collectd.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,62 @@
    FQDNLookup true
    LoadPlugin syslog

    <Plugin syslog>
    LogLevel info
    </Plugin>

    LoadPlugin amqp
    LoadPlugin battery
    LoadPlugin cpu
    LoadPlugin df
    LoadPlugin disk
    LoadPlugin entropy
    LoadPlugin interface
    LoadPlugin irq
    LoadPlugin load
    LoadPlugin memory
    LoadPlugin network
    LoadPlugin processes
    LoadPlugin rrdtool
    LoadPlugin swap
    LoadPlugin users

    <Plugin amqp>
    <Publish "name">
    Host "localhost"
    Port "5672"
    VHost "/"
    User "guest"
    Password "guest"
    Exchange "collectd.amq.fanout"
    ExchangeType "fanout"
    RoutingKey "collectd"
    Persistent false
    StoreRates false
    ConnectionRetryDelay 0
    Format "json"
    </Publish>
    </Plugin>

    <Plugin df>
    FSType rootfs
    FSType sysfs
    FSType proc
    FSType devtmpfs
    FSType devpts
    FSType tmpfs
    FSType fusectl
    FSType cgroup
    IgnoreSelected true
    </Plugin>

    <Plugin network>
    <Server "127.0.0.1" "25826">
    </Server>
    </Plugin>
    <Plugin rrdtool>
    DataDir "/var/lib/collectd/rrd"
    </Plugin>
    <Include "/etc/collectd/collectd.conf.d">
    Filter "*.conf"
    </Include>
  3. toff63 revised this gist Mar 21, 2016. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions collectd_and_influxdb.md
    Original file line number Diff line number Diff line change
    @@ -8,12 +8,16 @@ sudo apt-get install collectd # This should install collectd version 5.5.x
    ```

    ## Install Influxdb on Ubuntu 14.04
    ```
    curl -sL https://repos.influxdata.com/influxdb.key | sudo apt-key add -
    source /etc/lsb-release
    echo "deb https://repos.influxdata.com/${DISTRIB_ID,,} ${DISTRIB_CODENAME} stable" | sudo tee /etc/apt/sources.list.d/influxdb.list
    sudo apt-get update && sudo apt-get install influxdb
    sudo service influxdb start
    curl -G localhost:8086/query --data-urlencode "q=CREATE DATABASE collectd_db"
    ```



    ## Enable collectd input for influxdb
    Edit /etc/influxdb/influxdb.conf collectd section part with the following:
  4. toff63 revised this gist Mar 21, 2016. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions collectd_and_influxdb.md
    Original file line number Diff line number Diff line change
    @@ -45,5 +45,3 @@ sudo service collectd restart
    ```

    You should be able to find new series in collectd_db in influxdb admin page

    ![screenshot](https://gist.github.com/toff63/9f3b9f82382dcde8fafb#file-influxdb-png)
  5. toff63 revised this gist Mar 21, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion collectd_and_influxdb.md
    Original file line number Diff line number Diff line change
    @@ -46,4 +46,4 @@ sudo service collectd restart

    You should be able to find new series in collectd_db in influxdb admin page

    ![screenshot](influxdb.png)
    ![screenshot](https://gist.github.com/toff63/9f3b9f82382dcde8fafb#file-influxdb-png)
  6. toff63 revised this gist Mar 21, 2016. 1 changed file with 0 additions and 0 deletions.
    Binary file added influxdb.png
    Loading
    Sorry, something went wrong. Reload?
    Sorry, we cannot display this file.
    Sorry, this file is invalid so it cannot be displayed.
  7. toff63 revised this gist Mar 21, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion collectd_and_influxdb.md
    Original file line number Diff line number Diff line change
    @@ -46,4 +46,4 @@ sudo service collectd restart

    You should be able to find new series in collectd_db in influxdb admin page

    ![alt screenshot](screenshot.png)
    ![screenshot](influxdb.png)
  8. toff63 revised this gist Mar 21, 2016. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion collectd_and_influxdb.md
    Original file line number Diff line number Diff line change
    @@ -44,4 +44,6 @@ sudo service influxdb restart
    sudo service collectd restart
    ```

    You should be able to find new series in collectd_db in influxdb admin page
    You should be able to find new series in collectd_db in influxdb admin page

    ![alt screenshot](screenshot.png)
  9. toff63 renamed this gist Mar 21, 2016. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  10. toff63 created this gist Mar 21, 2016.
    47 changes: 47 additions & 0 deletions collectd_and_influxdb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,47 @@
    ## Install collectd on Ubuntu 14.04

    ```
    curl http://pkg.ci.collectd.org/pubkey.asc | sudo apt-key add -
    sudo bash -c 'echo "deb http://pkg.ci.collectd.org/deb/ trusty collectd-5.5" > /etc/apt/sources.list.d/collectd-ci.list'
    sudo apt-get update
    sudo apt-get install collectd # This should install collectd version 5.5.x
    ```

    ## Install Influxdb on Ubuntu 14.04
    curl -sL https://repos.influxdata.com/influxdb.key | sudo apt-key add -
    source /etc/lsb-release
    echo "deb https://repos.influxdata.com/${DISTRIB_ID,,} ${DISTRIB_CODENAME} stable" | sudo tee /etc/apt/sources.list.d/influxdb.list
    sudo apt-get update && sudo apt-get install influxdb
    sudo service influxdb start
    curl -G localhost:8086/query --data-urlencode "q=CREATE DATABASE collectd_db"

    ## Enable collectd input for influxdb
    Edit /etc/influxdb/influxdb.conf collectd section part with the following:
    ```
    [collectd]
    enabled = true
    bind-address = "localhost:25826"
    database = "collectd_db"
    typesdb = "/usr/share/collectd/types.db"
    ```

    # Have collectd sending data to influxdb
    Edit /etc/collectd/collectd.conf to enable the Network plugin uncommenting the line
    ```
    LoadPlugin network
    ```
    and add the following network plugin config
    ```
    <Plugin network>
    <Server "127.0.0.1" "25826">
    </Server>
    </Plugin>
    ```

    Restart influxdb and collectd:
    ```
    sudo service influxdb restart
    sudo service collectd restart
    ```

    You should be able to find new series in collectd_db in influxdb admin page