Linux/System Monitoring: Difference between revisions
From charlesreid1
(Created page with "=System Monitoring= What system monitoring entails: * inspect and manage processes * understand load average * available memory * checking stuff from a shell * disk space, st...") |
No edit summary |
||
| Line 11: | Line 11: | ||
* systemd init system | * systemd init system | ||
* systemd journal | * systemd journal | ||
==Controlling Processes== | |||
In order to control a process, you must be able to find a process. | |||
Use the ps command to list currently running processes, and pass the aux argument to show everything: | |||
<pre> | |||
$ ps aux | |||
</pre> | |||
This shows a lot of information. Filter it out with grep: | |||
<pre> | |||
$ ps aux | grep httpd | |||
</pre> | |||
This is also useful because it will display information about the cpu and memory usage. | |||
Now you can see its PID, and use that to kill the process: | |||
<pre> | |||
$ kill 15800 | |||
</pre> | |||
THis will send a SIGTERM, or Signal 15, to the process. There are 18 different signals you can send, the SIGTERM is the nice polite request that the process stop. | |||
<pre> | |||
$ man 7 signal | |||
</pre> | |||
If you want to send a different signal, like 12, or 2, | |||
<pre> | |||
$ kill -12 15800 | |||
$ kill -2 15800 | |||
</pre> | |||
or if you are desparate, send a SIGKILL, Signal 9: | |||
<pre> | |||
$ kill -9 15800 | |||
</pre> | |||
If you don't know the PID but you do know the process name, you can use the killall command: | |||
<pre> | |||
$ killall firefox | |||
</pre> | |||
Revision as of 03:14, 14 March 2016
System Monitoring
What system monitoring entails:
- inspect and manage processes
- understand load average
- available memory
- checking stuff from a shell
- disk space, storage available
- logging
- log size, log rotate
- systemd init system
- systemd journal
Controlling Processes
In order to control a process, you must be able to find a process.
Use the ps command to list currently running processes, and pass the aux argument to show everything:
$ ps aux
This shows a lot of information. Filter it out with grep:
$ ps aux | grep httpd
This is also useful because it will display information about the cpu and memory usage.
Now you can see its PID, and use that to kill the process:
$ kill 15800
THis will send a SIGTERM, or Signal 15, to the process. There are 18 different signals you can send, the SIGTERM is the nice polite request that the process stop.
$ man 7 signal
If you want to send a different signal, like 12, or 2,
$ kill -12 15800 $ kill -2 15800
or if you are desparate, send a SIGKILL, Signal 9:
$ kill -9 15800
If you don't know the PID but you do know the process name, you can use the killall command:
$ killall firefox
Related
| linux networking all the pages for linux networking
Diagnosing network interfaces: Linux/Network Interfaces Connecting to nodes with ssh: Linux/SSH Bridging networks with ssh tunnels: Linux/SSH Linux file server nfs/smb/sshfs: Linux/File Server Samba on linux: Linux/Samba Automounting network shares on linux: Linux/Automount Network Shares Monitoring system resources: Linux/System Monitoring Linux systemd: Linux/Systemd
IP Schema (ipcalc): Linux/IP Schema DHCP Server: Linux/DHCP DNS Server: Linux/DNS NTP Server: Linux/NTP
|