Last active
April 16, 2019 15:04
-
-
Save AgustinParmisano/6f8e82ff6cd0f300b15ce7e19b947341 to your computer and use it in GitHub Desktop.
nessus process resources checker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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