Tools for Monitoring Servers

Maintaining a webserver is no easy task, you will not know when the attack is about to happen but Usually occurs during your sleep.

There are various tools to monitor your server performance but for the most part it requires shell access to the server.

Checking Server Uptime
You can the server load by issuing uptime command via shell

$ uptime
08:54:38 up 5 days, 23:05, 1 user, load average: 0.05 0.01 0.14

the figures after load average are intervals of last minute, 5 minutes and fifteen minutes. Generally, a web server with a load of 2 to 3 is considered overloaded.

Another command to list the users logged into the system and the what they are doing

$ w
09:27:45 up 5 days, 23:38, 1 user, load average: 0.01, 0.02, 0.03
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root pts/0 xxx.xxx.xxx.xxx 08:35 0.00s 0.23s 0.00s w

Checking the Process List
To check the server for the current running processes issue the command

$ ps
PID TTY TIME CMD
3710 pts/0 00:00:00 bash
3942 pts/0 00:00:00 top
7590 pts/0 00:00:00 ps

Lists all processes of all users
$ ps aux

Lists every process in a heirarchical full format
$ ps -efH

Checking The Process List in Realtime
top command produces a list of running processes in realtime

$ top -c

Check The Running Processes in Detail
After issuing top command you can invistegate in detail what the running processes has opened using the

$ lsof -p pid#

Leave a Reply