Real-time monitoring of application logs with SSH and tail

Source: Internet
Author: User
Tags system log ssh tomcat rsyslog

In Linux monitoring System log, can use Rsyslog, but rsyslog regardless of application service log, to simple implementation of real-time monitoring remote system log should do. (Note: Real-time, simple)

With the tail command you can continue to update, plus SSH remote commands, as well as Cron, plus a simple script for the keyword.

1, first realize SSH free login

, refer to other ready-made bar: ssh password-free login.

It is strange that if you do not add-t RSA parameters, I did not try to succeed, 're told should be the same. It's depressing to remember what I used to do.

Once suspected is the host name resolution problem, the result is not, RSA Pub host name has no relationship, changed to the other did not affect.

2, the background remote execution tail, with Tomcat as an example

Nohup ssh xxx@xx.xx.x.xxx tail-f/home/xxx/tomcat/logs/catalina.out >> abc.log 2>&1 &

This allows us to get a remote log abc.log, with several logs to monitor multiple logs and multiple servers.

With this log, you can do other monitoring things.

3. Keyword filtering and alerting

Keyword filtering and business-related, email alerts have been written before.

4, because SSH tail may be disconnected, need additional monitoring to pay attention to the process situation, and even do a restart tail operation.

Slightly

5, the log will continue to grow regularly to the log file processing

Slightly

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.