Use LogSurfer + to supervise logon on Linux

Source: Internet
Author: User
Article Title: Use LogSurfer + to supervise logon on Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Currently, many tools are used to monitor logon files. The well-known common tool is swatch, which can be used to send reminders of some strings Based on logon files.
  
However, due to its limitations, the developer has created another tool called LogSurfer. Compared with swatch,
  
Because you need to create rules related to your network, it takes only a small amount of time to install LogSurfer +. First, download the tool from the LogSurfer and LogSurfer + Source pages. Then, edit and install the tool.
  
After the installation is complete, you can create rules. A rule is based on regular expressions that match your various behaviors, such as "ignore," "exec" (running a program) and "rule" (mainly creating a new rule).
  
This is a simple example of the rule, ignoring the login message "the last message was repeated xx times ".
  
'Last message repeated '---0
  
Ignore
  
This is the rule Syntax:
  
Match_regexnot_match_regexstop_regexnot_stop_regex timeout [continue] \ action
  
For example, you can use the following rules to log on to ssh on any master machine:
  
'^. {15,} (. *) sshd \ [. * session opened for user (. *)'---0
  
Open "$2 sshd login"-500 1200 600
  
Report "/usr/local/bin/mailop \" ssh login on $2 for $4 \ "\" $2 sshd login \"
  
If it is more complex, this rule runs the/usr/local/bin/mailop script to send a message, indicating that ssh Login occurs on a specific host and comes from a specific user.
  
You can see a variety of (for example, $2, $4, etc.), all represent the Regular Expression of matching. $2 corresponds to the second matched regexp, while $4 corresponds to the fourth matched regexp. This is the matching login column rule that corresponds to the machine name and user name. This is an example of creating a new relationship rule.
  
Installing LogSurfer + for the first time may be difficult, especially when you are not familiar with regular expressions. Check the LogSurfer configuration page of emf's to obtain other examples and use rules, including examples of many rules.

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.