Skip to content

Instantly share code, notes, and snippets.

@szaydel
Created May 21, 2013 21:12
Show Gist options
  • Save szaydel/5623295 to your computer and use it in GitHub Desktop.
Save szaydel/5623295 to your computer and use it in GitHub Desktop.
Basic high-level system state information.
#!/bin/bash
dt=$(date +"%Y%m%d")
hn=$(hostname)
commands=(
"zfs list"
"zfs get all"
"zpool list"
"zpool status"
"zfs list -t snapshot"
"echo ::arc|mdb -k"
"echo ::zfs_params|mdb -k"
"cat /var/adm/messages"
"fmdump -e -t90day"
"iostat -xnz 1 300"
"iostat -en"
"kstat -p"
"rtdmgr -sas"
"rtdmgr -bmsr"
"rtdmgr -HEALTHFULL"
"rtdmgr -EM"
"rtdmgr -E+"
"rtdmgr -MAP"
"rtdmgr -zdx"
"rtdmgr -zde"
"rtdmgr -zdT"
"rtdmgr -zdL"
)
for command in "${commands[@]}"; do
cmdname=$(echo $command|sed -e 's/[\|\:\/ *]/-/g')
logf=support-${cmdname}-${hn}-${dt}.log.gz
eval ${command} | gzip -c > $logf
done 2>/dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment