English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Linux swatch command

Linux Command大全

The Linux swatch command is used for system monitoring programs.

swatch can be used to monitor system log files and execute specified actions when specific events are detected. The events monitored by swatch and the corresponding actions for these events are stored in swatch's configuration file. The default configuration file is located at the root directory of the user. However, there is no .swatchrc configuration file in the default user root directory of Red Hat Linux, and you can/usr/doc/swatch-2.2/config_files/Copy swatchrc.personal file to the user's root directory as .swatchrc, and then modify the .swatchrc to monitor the events and execute the actions.

Syntax

swatch [-A <delimiter>]-c <configuration file>]-f <record file>]-I <delimiter>]-P <delimiter>]-r <time>]-t <record file>]

Parameter Description:

  • -A<delimiter> The delimiter for actions in the default configuration file, the default is comma.
  • -c<configuration file> Specify the configuration file instead of using the default configuration file.
  • -f<record file> Check the specified record file and stop monitoring after checking.
  • -I<delimiter> Specify the delimiter for input records, the default is newline character.
  • -P<delimiter> Specify the delimiter for events in the configuration file, the default is comma.
  • -r<time> Restart at the specified time.
  • -t<record file> Check the specified record file and monitor subsequent records added to the record file.

Online Examples

Enable System Monitoring

# swatch

Linux Command大全