This guide is a quick, and easy way to setup docker, prometheus, and grafana for getting the metrics from a Pure FlashArray.
yum clean all; yum install -y vim yum-utils && yum-config-manager -y --add-repo https://download.docker.com/linux/centos/docker-ce.repo && yum install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin && mkdir -p /etc/docker && systemctl start docker
curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc && chmod a+r /etc/apt/keyrings/docker.asc
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
apt-get update && apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
make directories and add files.
Compose was based on : https://github.com/docker/awesome-compose/blob/master/prometheus-grafana/compose.yaml
# make dirs
mkdir -p /opt/{grafana/{datasources,dashboards},prometheus}
# add docker compose
cat << EOF > /opt/compose.yaml
services:
prometheus:
image: prom/prometheus
container_name: prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
ports:
- 9090:9090
restart: unless-stopped
volumes:
- /opt/prometheus:/etc/prometheus
- prom_data:/prometheus
grafana:
image: grafana/grafana
container_name: grafana
ports:
- 3000:3000
restart: unless-stopped
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=Pa22word
volumes:
- /opt/grafana/datasources:/etc/grafana/provisioning/datasources
- /opt/grafana/dashboard.yaml:/etc/grafana/provisioning/dashboards/main.yaml
- /opt/grafana/dashboards:/var/lib/grafana/dashboards
volumes:
prom_data:
EOF
Pay attention to the IP and bearer_token
for the array!
# graf dashboard yaml
cat << EOF > /opt/grafana/dashboard.yaml
apiVersion: 1
providers:
- name: "Dashboard provider"
orgId: 1
type: file
disableDeletion: true
updateIntervalSeconds: 10
allowUiUpdates: false
options:
path: /var/lib/grafana/dashboards
foldersFromFilesStructure: true
EOF
# graf datasource
cat << EOF > /opt/grafana/datasources/datasource.yml
apiVersion: 1
datasources:
- name: Prometheus
type: prometheus
url: http://prometheus:9090
isDefault: true
access: proxy
editable: true
EOF
# get dashboard
curl -s https://raw.githubusercontent.com/PureStorage-OpenConnect/pure-fa-openmetrics-exporter/refs/heads/master/extra/grafana/grafana-purefa-flasharray-overview.json -o /opt/grafana/dashboards/puredash.json
# prom config
cat << EOF > /opt/prometheus/prometheus.yml
global:
scrape_interval: 30s # Set the scrape interval to every 30 seconds. Default is every 1 minute.
scrape_timeout: 30s # Set the scrape timeout to shorter than or equal to scrape_interval. Default is every 1 minute.
# evaluation_interval: 60s # is set to the default every 1 minute.
# Alertmanager configuration (optional)
#alerting:
# alertmanagers:
# - static_configs:
# - targets:
# - alertmanager:9093
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'. (optional)
#rule_files:
# - "purefa_alerts_rules.yml"
# - "purefa_pods_rules.yml"
scrape_configs:
- job_name: 'purefa_array'
scheme: https
tls_config:
insecure_skip_verify: true
bearer_token : 3d84e613-c905-649a-2b7a-0bc8def997e9
params:
namespace: ['purefa']
static_configs:
- targets:
- 192.168.1.11
labels:
location: us
site: Edgewater
instance: arrayname01
env: production
EOF
now run : cd /opt; docker compose up -d
prom : http://192.168.1.174:9090/targets
graf : http://192.168.1.174:3000
For more information on the alerts check out the github page.
https://github.com/PureStorage-OpenConnect/pure-fa-openmetrics-exporter/tree/master/extra/prometheus