Project

General

Profile

ServerMonitoring » History » Version 5

Andreas Kohlbecker, 08/25/2011 03:38 PM

1 1 Andreas Kohlbecker
Linux Server Monitoring Tools and Tips
2
3
4
5 4 Andreas Kohlbecker
## Tips
6
7
8
9
### Reviewing atop history
10
11
12
When atop is installed on Debian it is running as daemon and writes raw samples to `/var/log/atop*` These samples can be replayed. E.g.:
13
14
~~~
15
atop -r /var/log/atop.log.1
16
~~~
17
You can step to the next sample by pressing **t** and switch the view modes **m** =memory **g** = general
18
19
20
21 1 Andreas Kohlbecker
22
## Monitoring Tools
23
24
25
26
### atop
27
28
29
The program atop is an interactive monitor to view the load on a Linux system. It shows the occupation of the most critical hardware resources (from a performance point of view) on system level, i.e. cpu, memory, disk and network.
30
31
It also shows which processes are responsible for the indicated load with respect to cpu- and memory load on process level; disk- and network load is only shown per process if a kernel patch has been installed. 
32
33
34
...
35
36
37
38
### dstat
39
40
41
Dstat is a versatile replacement for vmstat, iostat and ifstat. Dstat overcomes some of the limitations and adds some extra features.
42
43
44
Dstat allows you to view all of your system resources instantly, you can eg. compare disk usage in combination with interrupts from your IDE controller, or compare the network bandwidth numbers directly with the disk throughput (in the same interval).
45
46
47
Dstat also cleverly gives you the most detailed information in columns and clearly indicates in what magnitude and unit the output is displayed. Less confusion, less mistakes, more efficient.
48
49
50
Dstat is unique in letting you aggregate block device throughput for a certain diskset or network bandwidth for a group of interfaces, ie. you can see the throughput for all the block devices that make up a single filesystem or storage system.
51
52
53
Dstat allows its data to be directly written to a CSV file to be imported and used by OpenOffice, Gnumeric or Excel to create graphs. 
54
55
56
57 2 Andreas Kohlbecker
### collectl
58 1 Andreas Kohlbecker
59
60 2 Andreas Kohlbecker
http://collectl.sourceforge.net/
61 1 Andreas Kohlbecker
62
63 2 Andreas Kohlbecker
There are a number of times in which you find yourself needing performance data. These can include benchmarking, monitoring a system's general heath or trying to determine what your system was doing at some time in the past. Sometimes you just want to know what the system is doing right now. Depending on what you're doing, you often end up using different tools, each designed to for that specific situation.
64
65
66
Unlike most monitoring tools that either focus on a small set of statistics, format their output in only one way, run either interatively or as a daemon but not both, collectl tries to do it all. You can choose to monitor any of a broad set of subsystems which currently include buddyinfo, cpu, disk, inodes, infiniband, lustre, memory, network, nfs, processes, quadrics, slabs, sockets and tcp. 
67
68
69
70
The article [Try collectl for System Monitoring](http://www.serverwatch.com/tutorials/article.php/3937996/Try-collectlfor-System-Monitoring.htm) on serverwatch gives a introduction into collectl.
71
72
73
74
75 1 Andreas Kohlbecker
### (At)sar
76 2 Andreas Kohlbecker
77
78
atsar — system activity report
79
80
81
The program atsar(1) can be used to deliver statistics.  The design  of
82
83
this  program  can  be  compared  with  the standard sadc(1) and sar(1)
84
85
programs being delivered for other UNIX-implementations, i.e.  a  data-
86
87
collector  which  reads  the statistical counters (from the files under
88
89
the directory /proc ) and  a  presentation-program  which  formats  the
90
91
counters and presents them on stdout.
92
93
94 3 Andreas Kohlbecker
_ **collectl** is newer utility and is supposed to be preferred from atsar._
95 1 Andreas Kohlbecker
96
97
98
99
### monit
100
101
102
monit is a utility for managing and monitoring processes, files, directories and devices on a Unix system. Monit conducts automatic maintenance and repair and can execute meaningful causal actions in error situations. E.g. monit can start a process if it does not run, restart a process if it does not respond and stop a process if it uses to much resources. You may use monit to monitor files, directories and devices for changes, such as timestamps changes, checksum changes or size changes.
103
104
105
Monit is controlled via an easy to configure control file based on a free-format, token-oriented syntax. Monit logs to syslog or to its own log file and notifies you about error conditions via customizable alert messages. Monit can perform various TCP/IP network checks, protocol checks and can utilize SSL for such checks. Monit provides a http(s) interface and you may use a browser to access the monit program. 
106
107
108
see also **monin** 
109
110
111
112
### monin
113
114
115
see also **monit** 
116 5 Andreas Kohlbecker
117
118
119
## Apache log-file analyses
120
121
122
123
### asql
124
125
126
http://www.steve.org.uk/Software/asql/
127
128
129
asql is a simple console shell which allows you to run SQL queries against an Apache logfile, something that can be very useful - especially at getting information which is not easily available via static logfile analysers.
130
131
132
can be installed via apt-get