Skip to content

Instantly share code, notes, and snippets.

@merps
Last active August 14, 2019 18:47
Show Gist options
  • Select an option

  • Save merps/e023e22a7b5a595a35e6d3d8e5e5a000 to your computer and use it in GitHub Desktop.

Select an option

Save merps/e023e22a7b5a595a35e6d3d8e5e5a000 to your computer and use it in GitHub Desktop.
F5 Telemetry Lab

F5 Telemetry cheat sheet for Red Hat/CentOS 7.x

Brain dump of a as-built home-lab for CentOS 7.x and docker v1.12

Step 1: Prep for RH/CentOS 7.x

sudo yum -y -q update
sudo yum -y -q install epel-release

Enable any kernel updates:

reboot

Step 2: Install docker

sudo yum -y -q install docker

Step 3: Pull Docker Images:

sudo docker pull prom/prometheus
sudo docker pull statsd/statsd
sudo docker pull prom/statsd-exporter

Step 4: Create Paths/files

mkdir ~/.statsd && cd $_
touch ./config.js

mkdir ~/.statsd-exporter && cd $_
touch ./bigip-mappings.yaml

mkdir ~/.prometheus && cd $_
touch ./{prometheus,bigip}.yml

Step 4: Configure statsd

~/.statsd/config.js

{
 port: 8125,
 mgmt_port: 8126,
 backends: [ "./backends/console", "./backends/repeater" ],
 repeater: [ { host: '<docker-host-ip>', port: 8105 } ]
}

Step 5: Configure statsd-exporter

~/.statsd-exporter/bigip-mappings.yaml

mappings:
  - match: "f5telemetry.*.system.*"
    name: "f5system"

Step 6: Configure prometheus

~/.prometheus/prometheus.yaml

# Global config
global:
  scrape_interval:     15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
  evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
  scrape_timeout: 15s  # scrape_timeout is set to the global default (10s).

# A scrape configuration containing exactly one endpoint to scrape:# Here it's Prometheus itself.
scrape_configs:
  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
  - job_name: 'prometheus'

    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.

    static_configs:
    - targets: ['localhost:9090']

  - job_name: 'f5-ts-example'

    static_configs:
    - targets: ['<docker-host-ip>:9102']

Step 7: Start statsd:

docker run -e GRAPHITE_HOST=127.0.0.1 -e STATSD_DUMP_MSG=true \
    -v ~/.statsd/config.js:config.js
    -p 8125:8125/udp -p 8126:8126/tcp -d statsd/statsd

Step 8: Start statsd-exporter:

docker run --name=prom-statsd-exporter \
    -p 9123:9102 \
    -p 8125:8105/udp \
    -v ~/.statsd-exporter/bigip-mappings.yaml:/tmp/bigip-mappings.yaml \
    prom/statsd-exporter \
    --statsd.mapping-config=/tmp/bigip-mappings.yaml \
    --statsd.listen-udp=:8105 \
    --web.listen-address=:9102

Step 9: Start prometheus:

docker run --name=prometheus \
    -p 9090:9090 \
    -v ~/.prometheus/prometheus.yaml:/prometheus.yaml \
    prom/prometheus \
        --config.file=/prometheus.yml \
        --log.level=debug \
        --web.listen-address=:9090 \
        --web.page-title='Prometheus - BIGIP TS'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment