Lots of work on stats, including an awesome Ansible-NAS Grafana dashboard

This commit is contained in:
David Stephens 2020-04-20 00:14:33 +01:00
parent c354802d71
commit 0a9ea0da86
4 changed files with 5337 additions and 13 deletions

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,24 @@
apiVersion: 1
providers:
# <string> an unique provider name
- name: 'Ansible-NAS Dashboards'
# <int> org id. will default to orgId 1 if not specified
orgId: 1
# <string, required> name of the dashboard folder. Required
folder: 'Ansible-NAS'
# <string> folder UID. will be automatically generated if not specified
folderUid: ''
# <string, required> provider type. Required
type: file
# <bool> disable dashboard deletion
disableDeletion: false
# <bool> enable dashboard editing
editable: true
# <int> how often Grafana will scan for changed dashboards
updateIntervalSeconds: 60
# <bool> allow updating provisioned dashboards from the UI
allowUiUpdates: false
options:
# <string, required> path to dashboard files on disk. Required
path: /var/lib/grafana/dashboards/ansible-nas

View file

@ -16,9 +16,11 @@
with_items:
- "{{ grafana_data_directory }}"
- "{{ grafana_data_directory }}/data"
- "{{ grafana_data_directory }}/data/dashboards/ansible-nas"
- "{{ grafana_data_directory }}/config/"
- "{{ grafana_data_directory }}/config/provisioning"
- "{{ grafana_data_directory }}/config/provisioning/datasources"
- "{{ grafana_data_directory }}/config/provisioning/dashboards"
- name: InfluxDB
docker_container:
@ -34,6 +36,18 @@
INFLUXDB_LOGGING_LEVEL: "error"
memory: 1g
- name: hddtemp
docker_container:
name: hddtemp
image: drewster727/hddtemp-docker
pull: true
privileged: true
restart_policy: unless-stopped
env:
HDDTEMP_ARGS: "-q -d -F /dev/sd*"
TZ: "{{ ansible_nas_timezone }}"
memory: 128m
- name: Template telegraf.conf
template:
src: telegraf/telegraf.conf
@ -44,9 +58,26 @@
name: telegraf
image: telegraf
pull: true
links:
- hddtemp:hddtemp
privileged: true
ipc_mode: host
volumes:
- "{{ telegraf_data_directory }}/telegraf.conf:/etc/telegraf/telegraf.conf:ro"
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "/:/hostfs:ro"
- "/etc:/hostfs/etc:ro"
- "/proc:/hostfs/proc:ro"
- "/sys:/hostfs/sys:ro"
- "/var:/hostfs/var:ro"
- "/run:/hostfs/run:ro"
env:
HOST_ETC: "/hostfs/etc"
HOST_PROC: "/hostfs/proc"
HOST_SYS: "/hostfs/sys"
HOST_VAR: "/hostfs/var"
HOST_RUN: "/hostfs/run"
HOST_MOUNT_PREFIX: "/hostfs"
restart_policy: unless-stopped
memory: 1g
@ -55,6 +86,16 @@
src: grafana/provisioning/datasources/ansible-nas.yml
dest: "{{ grafana_data_directory }}/config/provisioning/datasources/ansible-nas.yml"
- name: Copy Ansible-NAS Dashboard Provisioner
copy:
src: grafana/provisioning/dashboards/ansible-nas.yml
dest: "{{ grafana_data_directory }}/config/provisioning/dashboards/ansible-nas.yml"
- name: Copy Ansible-NAS Dashboard
copy:
src: grafana/dashboards/ansible-nas/ansible-nas-overview.json
dest: "{{ grafana_data_directory }}/data/dashboards/ansible-nas/ansible-nas-overview.json"
- name: Grafana
docker_container:
name: grafana

View file

@ -271,17 +271,17 @@
# insecure_skip_verify = false
# # Monitor disks' temperatures using hddtemp
# [[inputs.hddtemp]]
# ## By default, telegraf gathers temps data from all disks detected by the
# ## hddtemp.
# ##
# ## Only collect temps from the selected disks.
# ##
# ## A * as the device name will return the temperature values of all disks.
# ##
# # address = "127.0.0.1:7634"
# # devices = ["sda", "*"]
# Monitor disks' temperatures using hddtemp
[[inputs.hddtemp]]
## By default, telegraf gathers temps data from all disks detected by the
## hddtemp.
##
## Only collect temps from the selected disks.
##
## A * as the device name will return the temperature values of all disks.
##
address = "hddtemp:7634"
devices = ["*"]
# Read metrics about network interface usage
[[inputs.net]]
@ -309,7 +309,7 @@
# remove_numbers = true
# # Read metrics from storage devices supporting S.M.A.R.T.
# Read metrics from storage devices supporting S.M.A.R.T.
# [[inputs.smart]]
# ## Optionally specify the path to the smartctl executable
# # path = "/usr/bin/smartctl"
@ -418,5 +418,5 @@
# kstatMetrics = ["abdstats", "arcstats", "dnodestats", "dbufcachestats",
# "dmu_tx", "fm", "vdev_mirror_stats", "zfetchstats", "zil"]
## By default, don't gather zpool stats
# poolMetrics = false
poolMetrics = true