Skip to content

Instantly share code, notes, and snippets.

@adaam
Created November 1, 2016 09:42
Show Gist options
  • Save adaam/548462a0b50308e384d71294285ca1eb to your computer and use it in GitHub Desktop.
Save adaam/548462a0b50308e384d71294285ca1eb to your computer and use it in GitHub Desktop.
Parse "nfsstat -l" file to time serial, for gnuplot using
#!/bin/sh
while true
do
D=$(date +%s)
nfsstat -l > /home/XXX_USER/nfsstat_log/$D
sleep 5
done
#!/bin/bash
# Run below script a while to get data
# while true; do D=$(date +%s);nfsstat -l > /home/XXX_USER/nfsstat_log/$D; sleep5;done
p="/home/XXX_USER/nfs_plot"
files=$(ls ~/nfsstat_log/)
for file in $files
do
while read -r f1 f2 f3 f4 f5 f6;
do
echo ${file} ${f2}_${f3}_${f4} ${f5}
echo ${file} ${f5} >> ${f2}_${f3}_${f4}.txt
done < ~/nfsstat_log/${file}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment