如何在 Debian 和 Ubuntu 上使用 Logwatch 监控服务器日志文件如何在 Debian 和 Ubuntu 上使用 Logwatch 监控服务器日志文件如何在 Debian 和 Ubuntu 上使用 Logwatch 监控服务器日志文件如何在 Debian 和 Ubuntu 上使用 Logwatch 监控服务器日志文件
  • 文章
  • 正则表达式
    • 工具
  • 登录
找到的结果: {phrase} (显示: {results_count} 共: {results_count_total})
显示: {results_count} 共: {results_count_total}

加载更多搜索结果...

搜索范围
模糊匹配
搜索标题
搜索内容
发表 admin at 2025年2月28日
类别
  • 未分类
标签

如何在 Debian 和 Ubuntu 上使用 Logwatch 监控服务器日志文件

在此页

  1. 正在安装 Logwatch。
  2. 配置 Logwatch。
  3. 其他 logwatch 选项
  4. 链接

Logwatch 是一个系统日志分析器和报告器。本教程涵盖了 Logwtach 的安装并解释了各种配置选项,包括。通过电子邮件报告重要的日志事件。

安装 Logwatch。

以下命令将在您的服务器上安装 Logwatch。

Ubuntu

sudo apt-get install logwatch

德比安

apt-get install logwatch

配置 Logwatch。

nano /usr/share/logwatch/default.conf/logwatch.conf
MailTo = root change it to MailTo = 
Range = All
logwatch [--detail level ] [--logfile log-file-group ] [--service ser‐ vice-name ] [--mailto address ] [--archives] [--range range ] [--debug level ] [--filename file-name ] [--logdir directory ] [--hostname host‐ name ] [--hostformat host based options ] [--output output-type ] [--format report format ] [--encode encoding to use ] [--numeric] [--version] [--help|--usage]

您可以使用它来手动使用 logwatch 并跳过所有上述配置。

logwatch --detail High --service http --mailto  --range all --logdirectory /var/cache/logwatch

以上是用户根据自己的需要自定义的命令,你继续检查,什么适合你的需要。

额外的 logwatch 选项

Logwatch的使用信息可以通过man page获取:

man logwatch

手册页中标题为“更多信息”的部分列出了分发版中可用的其他文档文件。

可以使用 --help 选项获取手册页中描述的命令行开关的摘要:

logwatch --help

链接

  • 日志观察

©2015-2025 艾丽卡 support@alaica.com