From charlesreid1

Revision as of 03:14, 14 March 2016 by Admin (talk | contribs)

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