Skip to content

Instantly share code, notes, and snippets.

@AgustinParmisano
Last active April 16, 2019 15:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AgustinParmisano/6f8e82ff6cd0f300b15ce7e19b947341 to your computer and use it in GitHub Desktop.
Save AgustinParmisano/6f8e82ff6cd0f300b15ce7e19b947341 to your computer and use it in GitHub Desktop.
nessus process resources checker
#!/bin/bash
top -b -c -p $(pgrep -d',' -f nessusd) > top.dat &
while :
do
for i in {1..50} :
do
cat top.dat | grep nessusd | cut -c 50-53 > nessus_cpu.txt
sleep 5
data=$(awk '/./{line=$0} END{print line}' nessus_cpu.txt)
datadate="$(date +"%d/%m/%y %T"), $data"
echo $datadate >> nessus_cpu_datadate.txt
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment