Saturday, July 2, 2011

System Monitoring basics

This is just an overview of few of the system administration tools. Infos about what programs are running, how much memory or how much cpu cycles are being used, who are logged in and for how long. 


top: it provides a lot of information about the processes running, percentatage of the cpu and th ememory being consumed by that process, who owns the process and its Process ID. It also shows the uptime and memory usage. The output is a dynamic full screen.  Using hot key k any process can be killed. Press M to sort by memory, P to sort by %CPU and S to sort by time.
duit shows the disk usage(in Kb) of each directory and sub-directories. It checks recursively and starts from the current folder by default. By supplying a name you can make it start from there.
Options: (these may vary with version run, and there are more ;)
-a (--all) Prints usage for ALL files, not just the subdirectories
-b (--bytes) Prints usage in bytes rather than Kb.
-s (--summarize) Prints ONLY the total usage of the directory
df: this command tells about the amount of free space on all mounted file system, or the name of a device can be specified. It will show the size, used space, available space, used% and mount information.
ps: this command shows what processes are running with your user id. ps aux command gives additional information about all processes. This is similar to top except that it gives only a snapshot and is not updated. 
vmstat: This command  reports information about processes, memory, paging, block IO, traps and cpu activity. 
-a Gives information about Active/Inactive Memory Pages
-m Displays Memory utilization
who: It displays the users who are logged into the system
uptime: to get the uptime, together with the current time, the number of users and load averages for the past 1, 5 and 15 minute intervals
w: It displays information about users currently logged into the machine and their processes. It is a combination of who, uptime, and ps.
free: shows information about the machine's memory. This includes physical memory (RAM), swap as well as the shared memory and buffers used by the kernal. All measurements are in Kb.
iostat: It report Central Processing Unit (CPU) statistics and input/output statistics for devices, partitions and network file systems (NFS).
mpstatdisplays activities for each available processor, processor 0 being the first one. mpstat -P ALL to display average CPU utilization per processor.
man the above commands to learn more

No comments:

Post a Comment