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