userguide:how_to_use_linux_shell_2

Subtitle: Server check

Version / revision: V1.0 / R 0.0.

For Nethserver all version.

Skill: Novice / Beginner

Date of presentation: Released on 2016-06-25


This howto is intended for beginners.
From linux shell you can make various checks on a server. There are simple commands (but very powerful) that allow an efficient analysis of a server to test problems or performance.
I will list some of the many existing commands (for each one would need a howto…).
It would be interesting to integrate it with the ideas of all.

For many of the following commands must be enabled rpmforge and EPEL repository (disable it at the end!)

wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh epel-release-6-8.noarch.rpm

wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
rpm -Uvh rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt

Install:
No need to install
Command:

top

Standard program to check processor activity in real time. Lists the use of ram and cpu for every user processes.

Installation:

yum install htop

Command:

htop

As top but more user friendly. Permit filter by process, user…

Installation:
No need to install
Command:

ps aux
ps -fp $(pgrep -d, http)

It lists the active processes. With the appropriate parameters it allows to monitor specific processes.

Installation:
No need to install
Command:

kill -9 1234
killall -9 clamd

This command is used to terminate one or more processes.
Kill requires one or more pid (separated by space); killall terminates the process by name.

Installation:

yum install iftop

Command:

iftop

Very intuitive utility to verify the use of server's bandwidth. It identifies source and destination IP.

Installation:

yum install tcptrack

Command:

tcptrack -i eth0

Captures network packets and determines the use of bandwidth for each IP / service.

Installation:

yum install iptraf

Command:

iptraf

Network traffic tool. Displays for each interface tcp, udp, icmp and non IP traffic identifying source and destination.

Installation:
No need to install
Command:

tcpdump -i eth0
tcpdump -i eth0 > file.txt

Useful program to capture the real-time network traffic.

Installation:
No need to install
Command:

netstat -r
netstat -lnp
netstat -a |grep ssh

Very useful network tool. Depending on the switch, you can check the settings or analyze the listening processes.

Installation:

yum install trafshow

Command:

trafshow -i eth0
trafshow -n -i eth0 tcp

Monitoring network traffic in real time.

Installation:
No need to install
Command:

lsof 
lsof |grep "stringa" 
lsof +D /var/log/

Command line utility used to list information about the files that are opened.

Installation:

yum install iotop

Command:

iotop
iotop -o

Program to monitor in real time the disk activity. It identify the processes that cause it.
With -o parameter displays only the processes that generate traffic, hiding inactive.

Installation:
No need to install if samba is installed
Command:

sbmstatus

Command that lists the files opened by samba share.

  • userguide/how_to_use_linux_shell_2.txt
  • Last modified: 2016/06/25 21:11
  • by Vincenzo