2024-08-01 13:00:20 -04:00
2024-06-04 13:18:08 -04:00
2024-08-01 13:00:20 -04:00
2024-06-05 16:34:02 -04:00
2024-08-01 11:47:21 -04:00

about

This program has been tested on TrueNAS CORE and SCALE Will automatically upload to our FTP server.

If they are airgapped, they can take a debug to get stats.

clone repo

git clone https://gitlab.komputernerds.com/mmance/statscollect.git

run program

  cd statscollect
  python3 collect.py

collection on CORE

Disk

iostat -xyd 1 1

iostat = [ "timestamp", "name", "read_s", "rkB_s", "rrqm_s", "%rrqm", "r_await", "rareq-sz", "w_s", "wkB_s", "wrqm_s", "%wrqm", "w_await", "wareq-sz", "d_s", "dkB_s", "drqm_s", "%drqm", "d_await", "dareq-sz", "f_s", "f_await", "aqu-sz", "%util", ]

CPU

iostat -c 1 1

cpustat = [ "timestamp", "name", "%user", "%nice", "%system", "%iowait", "%steal", "%idle", ]

Memory

top -bn 1

memstat = [ "timestamp", "name", "mem_used", "mem_free", ]

Network

ifstat -znq 1 1

ifstat = [ "timestamp", "name", "Kbps_in", "Kbps_out", ]

ZFS

zpool iostat -Tu -l -p -v -y 15 1

ziostat = [ "timestamp", "name", "capacity_alloc", "capacity_free", "ops_read", "ops_write", "bandwidth_read", "bandwidth_write", "total_wait_read", "total_wait_write", "disk_wait_read", "disk_wait_write", "syncq_wait_read", "syncq_wait_write", "asyncq_wait_read", "asyncq_wait_write", "scrub_wait", "trim_wait", "rebuld_wait", ]

collection on SCALE

Disk

gstat -C -s -d -o -p -I 5s

gstat = [ "timestamp", "name", "q-depth", "total_ops_s", "read_s", "read_sz-KiB", "read-KiB_s", "ms_read", "write_s", "write_sz-KiB", "write-KiB_s", "ms_write", "delete_s", "delete-sz-KiB", "delete-KiB_s", "ms_delete", "other_s", "ms_other", "%busy", ]

CPU

iostat -C -t proc -d

cpustat = [ "timestamp", "name", "%user", "%nice", "%system", "%iowait", "%steal", "%idle", ]

Memory

top -n 1

memstat = [ "timestamp", "name", "mem_used", "mem_free", ]

Network

ifstat -znq 1 1

ifstat = [ "timestamp", "name", "Kbps_in", "Kbps_out", ]

ZFS

zpool iostat -Tu -l -p -v -y 15 1

ziostat = [ "timestamp", "name", "capacity_alloc", "capacity_free", "ops_read", "ops_write", "bandwidth_read", "bandwidth_write", "total_wait_read", "total_wait_write", "disk_wait_read", "disk_wait_write", "syncq_wait_read", "syncq_wait_write", "asyncq_wait_read", "asyncq_wait_write", "scrub_wait", "trim_wait", "rebuld_wait", ]

Example

  root@m40g2-124a[~/statscollect]# python3 collect.py
  ########################################################################
  #         FreeNAS CORE/SCALE performance capture script v.02           #
  ########################################################################
  #         This script collects cpu/mem/disk/network/pool               #
  # When it is completed, it will copy csv files to your /var/log folder #
  # It will then attempt to take a debug and upload both to our FTP      #
  # If not connected to the internet, it will have to be manually d/l    #
  ########################################################################
  #   Running this script repeatedly will append results to CSV files    #
  #       - https://gitlab.komputernerds.com/mmance/statscollect -       #
  ########################################################################

  Enter the duration in minutes: 5
  Enter the delay before capture in minutes: 2
  Delaying capture by 2 minutes...
  0 1 Starting Collection
  Minute: 0 1 2 3 4
  Copied 'ifStat.csv' to /var/log successfully.
  Copied 'gstat.csv' to /var/log successfully.
  Copied 'cpuStat.csv' to /var/log successfully.
  Copied 'boot-pool-zio.csv' to /var/log successfully.
  Copied 'memStat.csv' to /var/log successfully.
  Copied 'tank-zio.csv' to /var/log successfully.
  Taking new debug.
    % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
				   Dload  Upload   Total   Spent    Left  Speed
  100 1969k    0     0  100 1969k      0  2055k --:--:-- --:--:-- --:--:-- 2055k
  Data collection and upload completed.
  root@m40g2-124a[~/statscollect]#
Description
No description provided
Readme 119 KiB
Languages
Python 97.1%
Shell 2.9%