我们正在使用 Nagios 来监控我们的网络并取得了巨大成功。但是,我们有一个用于严重应用程序错误的系统日志,当我设置 check_log 时,它似乎不像监控设备那样工作。
问题是:
- 它只显示最后一个条目
- 似乎没有办法确认严重错误并将监视器恢复到良好状态
nagios 是错误的工具,还是我们没有正确设置服务监控?
这是我的条目
# log file
define command{
command_name check_log
command_line $USER1$/check_log -F /var/log/applications/appcrit.log -O /tmp/appcrit.log -q ?
}
# Define the log monitering service
define service{
name logfile-check ;
use generic-service ;
check_period 24x7 ;
max_check_attempts 1 ;
normal_check_interval 5 ;
retry_check_interval 1 ;
contact_groups admins ;
notification_options w,u,c,r ;
notification_period 24x7 ;
register 0 ;
}
define service{
use logfile-check
host_name localhost
service_description CritLogFile
check_command check_log
}