// Commands to gather OS level (systemd) data // Collect Linux processes and system real-time information with top. This command includes the // -b flag for batch (needed to redirect to a file) and the -n flag to specify the number of iterations. // This command will run for 18 seconds, and send the output to the specified file top -b -n 5 > top-output.txt // Check memory usage free -ht // Check file system disk space usage df -h // Check open tcp connections. requires sudo or root access sudo ss -tnlp // Check for open files. Requires sudo or root access. lsof might not be installed; // there is no tidy equivalent. sudo lsof -p $(pgrep vault) > lsof-vault-output.txt // if lsof cannot be installed, try: // to get PID of vault pgrep vault // to list the file descriptors for the vault processes. requires sudo or root access // update to the output from pgrep command. sudo ls -l /proc//fd > proc-vault-ls-output.txt // Collect vault server operational logs journalctl -b --no-pager -u vault | gzip -9 > /tmp/"$(hostname)-$(date +%Y-%m-%dT%H-%M-%SZ)-vault.log.gz"