Script to run top command after every 5 minutes CPU utilization:
#!/bin/sh
top -b -n 1 | head -17 >> /var/log/logging.txt
echo “=========” >> /var/log/logging.txt
To show CPU and process information (press q to quit):
#top (resource usage and running processes)
(uptime and the load average)
(CPU usage: us for users, sy for system and ni for nice processes)(id is idle time, wa is wait state)
(if the wa is high that means the smoothwall is busy with extensive logs or reports)
(press ‘F’ to set the fields and ‘d’ to set it)
#htop (resource usage and running processes)(same as top but better layout)