System information commands

#vmstat (summary information for system load and usage, but does not show individual processes)

#ps aux (display all processes running on the Linux system)(to search for specific processes or list them all)

#ps aux | grep auth (all the processes that have auth in them)

#ps auxf | sort -nr -k 4 | head -10 (shows the top 10 memory consuming processes)

#cat /proc/cpuinfo (lot of information about the system and the hardware associated)

#cat /proc/meminfo (information on memory and memory usage)

#cat /proc/mounts (various file systems and where they are mounted and which options have been used)

#df -h (Show a summary of disk usage and some useful key combinations Keyboard Combinations SHIFT + PAGE UP scroll up the screen CTRL + C stop a running command eg ping)

Duplex and Speed on Linux

To check duplex and speed on the Smoothwall:

#ethtool ethA (always recommended to set the auto-negotiate on the switch side for the interface where Smoothwall is connected)

(for example to change the MTU size on the fly for testing purposes) (Shows the network speed and information about the interface)

To change the speed, duplex and the auto-negotiate for an interface:

#ethtool -s ethX speed 100 duplex full autoneg off (to turn off the auto negotiate)

OR

#vi /etc/actions/secondboot/9999custom

(insert the following in the file)

#! /bin/sh

/usr/sbin/ethtool -s ethC duplex full speed 100 autoneg off

(now press escape :wq! )

#chmod +x /etc/actions/secondboot/9999custom

#/etc/actions/secondboot/9999custom

(Finally, you need to reboot to exectute the startup script created, if required)

Speed test (speedtest) / slow speed issue

Install iperf client on windows from:

https://iperf.fr/

or

Ubuntu using:

sudo apt-get install iperf

Try the following from the client machines inside the network and/or from the Smoothwall:

(using speedtest sites through the Smoothwall are not recommended)

iperf -c iperf.securityinspection.com

iperf -c iperf.saratov.ertelecom.ru

iperf -c st2.nn.ertelecom.ru

iperf -c iperf.ips.versatel.de

iperf -c iperf.testdebit.info

iperf -c iperf.cds.com

iperf -c iperf.lan.kth.se

(More servers can be found here: http://en.wikipedia.org/wiki/Iperf)

To see live traffic on an interface especially external interface (updates every second)

watch -n 1 /sbin/ifconfig ethC

To check the latest NIC drivers in the database for the Smoothwall’s linux kernel

#lspci -nnn (to check the ethernet controllers and the hardware detected by smoothwall)(To check the company ID and the unique hardware ID i.e. PCI-ID) (to check the ethernet controllers and the hardware detected by smoothwall)

or # lspci -nn | grep Eth

#cat /lib/modules/3.13.0-1-smp/modules.pcimap | grep 1533 | grep 8086

(you can put the kernel you are looking the drivers in instead of 3.13.0-1-smp and the current kernel can be checked using #uname -r)

CPU usage Linux scripts and commands

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)