How to use Linux swatch commands

Source: Internet
Author: User

Swatch can be used to monitor system records and perform specified actions when a specific event is detected. The events monitored by swatch and the actions of the corresponding events are stored in the swatch configuration file. The default configuration file is. swatchrc under the root directory. However, in Red Hat Linux, the default root directory does not exist. in the swatchrc configuration file, you can set/usr/doc/swatch-2.2/config_files/swatchrc. copy the personal file to. swatchrc, and then modify. the event to be monitored and the action to be executed by swatchrc.

Syntax

Swatch [-A <delimiter>] [-c <setting File>] [-f <Record File>] [-I <delimiter>] [-P <delimiter>]

[-R <time>] [-t <Record File>]

Parameter description:

  • -A <delimiter> specifies the delimiter of an action in the preset configuration file. The delimiter is A comma.
  • -C <Configuration File> specifies the configuration file, instead of the preset configuration file.
  • -F <Record File> checks the specified record file. After the check, it does not continue to monitor the record file.
  • -I <delimiter> specifies the delimiter of the input record. It is a newline character by default.
  • -P <delimiter> specifies the delimiter of the event in the configuration file. The default delimiter is comma.
  • -R <time> restarts at the specified time.
  • -T <Record File> checks the specified record file and monitors the subsequent records added to the record file.

Instance

Enable system monitoring

# Swatch

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.