首页 / CENTOS / Centos 日志处理
Centos 日志处理
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了Centos 日志处理,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含4617字,纯文字阅读大概需要7分钟。
内容图文
今天检查系统日志发现有,日志中都是以下格式的日志:
Apr 22 09:26:26 jsmapp4 xinetd[3158]: EXIT: nrpe status=0 pid=14006 duration=0(sec)
Apr 22 09:26:27 jsmapp4 xinetd[3158]: EXIT: nrpe status=0 pid=14316 duration=1(sec)
Apr 22 09:26:27 jsmapp4 xinetd[3158]: EXIT: nrpe status=0 pid=14323 duration=1(sec)
Apr 22 09:26:27 jsmapp4 xinetd[3158]: START: nrpe pid=15937 from=::ffff:192.168.1.60
Apr 22 09:26:27 jsmapp4 xinetd[3158]: EXIT: nrpe status=0 pid=15937 duration=0(sec)
Apr 22 09:27:19 jsmapp4 pptp[27991]: anon log[logecho:pptp_ctrl.c:677]: Echo Reply received.
Apr 22 09:27:26 jsmapp4 xinetd[3158]: START: nrpe pid=7318 from=::ffff:192.168.1.60
Apr 22 09:27:26 jsmapp4 xinetd[3158]: START: nrpe pid=7327 from=::ffff:192.168.1.60
Apr 22 09:27:26 jsmapp4 xinetd[3158]: START: nrpe pid=7332 from=::ffff:192.168.1.60
Apr 22 09:27:26 jsmapp4 xinetd[3158]: EXIT: nrpe status=0 pid=7318 duration=0(sec)
Apr 22 09:27:26 jsmapp4 xinetd[3158]: EXIT: nrpe status=0 pid=7327 duration=0(sec)
Apr 22 09:27:26 jsmapp4 xinetd[3158]: EXIT: nrpe status=0 pid=7332 duration=0(sec)
Apr 22 09:27:26 jsmapp4 xinetd[3158]: START: nrpe pid=7652 from=::ffff:192.168.1.60
Apr 22 09:27:26 jsmapp4 xinetd[3158]: EXIT: nrpe status=0 pid=7652 duration=0(sec)
Apr 22 09:27:27 jsmapp4 xinetd[3158]: START: nrpe pid=8952 from=::ffff:192.168.1.60
Apr 22 09:27:27 jsmapp4 xinetd[3158]: EXIT: nrpe status=0 pid=8952 duration=0(sec)
通过分析以上日志发现:
xinetd是新一代的网络守护进程服务程序,又叫超级Internet服务器,常用来管理多种轻量级Internet服务。
这个进程来自于 192.168.1.60 这个 ip ,明显是内网 ip ,以前没有发现这个问题,奇怪。
去 60 这台服务器查看发现,有 nagios 警告的日志:
Apr 22 09:50:02 jsmbak1 nagios: Warning: The check of host ‘jsmapp1‘ looks like it was orphaned (results never came back). I‘m scheduling an immediate check of the host...
Apr 22 09:50:24 jsmbak1 nagios: Warning: The check of service ‘check_mem‘ on host ‘jsmapp4‘ looks like it was orphaned (results never came back). I‘m scheduling an immediate check of the service...
Apr 22 09:51:02 jsmbak1 nagios: Warning: The check of service ‘Current Load‘ on host ‘Nagios-Server‘ looks like it was orphaned (results never came back). I‘m scheduling an immediate check of the service...
Apr 22 09:51:02 jsmbak1 nagios: Warning: The check of service ‘SSH‘ on host ‘Nagios-Server‘ looks like it was orphaned (results never came back). I‘m scheduling an immediate check of the service...
Apr 22 09:51:02 jsmbak1 nagios: Warning: The check of service ‘Total Processes‘ on host ‘Nagios-Server‘ looks like it was orphaned (results never came back). I‘m scheduling an immediate check of the service...
Apr 22 09:51:02 jsmbak1 nagios: Warning: The check of service ‘HTTP‘ on host ‘jsmapp2‘ looks like it was orphaned (results never came back). I‘m scheduling an immediate check of the service...
Apr 22 09:51:02 jsmbak1 nagios: Warning: The check of service ‘HTTP‘ on host ‘jsmapp3‘ looks like it was orphaned (results never came back). I‘m scheduling an immediate check of the service...
Apr 22 09:51:46 jsmbak1 xinetd[16796]: START: nrpe pid=17625 from=::ffff:127.0.0.1
Apr 22 09:51:46 jsmbak1 xinetd[16796]: EXIT: nrpe status=0 pid=17625 duration=0(sec)
Apr 22 09:52:50 jsmbak1 xinetd[16796]: START: nrpe pid=17890 from=::ffff:127.0.0.1
Apr 22 09:52:50 jsmbak1 xinetd[16796]: EXIT: nrpe status=0 pid=17890 duration=0(sec)
Nagios 是一款开源的免费网络监视工具,能有效监控 Windows 、 Linux 和 Unix 的主机状态、交换机、 路由器 等网络设置,打印机等。
Nagios 可以监控的功能有:
1、监控网络服务(SMTP、POP3、HTTP、NNTP、PING等);
2、监控主机资源(处理器负荷、磁盘利用率等);
3 、简单地插件设计使得用户可以方便地扩展自己服务的检测方法;
4 、并行服务检查机制;
5 、具备定义网络分层结构的能力,用 "parent" 主机定义来表达网络主机间的关系,这种关系可被用来发现和明晰主机宕机或不可达状态;
6 、当服务或主机问题产生与解决时将告警发送给联系人(通过 EMail 、短信、用户定义方式);
7 、具备定义事件句柄功能,它可以在主机或服务的事件发生时获取更多问题定位;
8 、自动的日志回滚;
9 、可以支持并实现对主机的冗余监控;
10 、可选的 WEB 界面用于查看当前的网络状态、通知和故障历史、日志文件等;
查看 nagios 进程发现,有多个进程
[root@jsmbak1 ~]# ps -ef|grep "bin/nagios"
root 4913 4095 0 11:12 pts/2 00:00:00 grep bin/nagios
nagios 5146 1 0 Feb18 ? 01:12:40 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
nagios 5286 1 0 Feb19 ? 01:15:13 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
nagios 9767 1 0 Feb18 ? 01:13:52 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
使用 [nagios@jsmbak1 ~]$ killall nagios ,杀掉所有 nagios ,然后重启
/usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
如果想停止 nrpe 服务在 xinetd 下的日志输出
修改配置文件,禁用成功状态下的日志
[root@jsmapp3 tomcat]# vi /etc/xinetd.conf
# Define general logging characteristics.
log_type = SYSLOG daemon info
log_on_failure = HOST
# log_on_success = PID HOST DURATION EXIT
重新服务xinetd后再次查看日志,不再出现nrpe相关日志
[root@jsmapp3 tomcat]# service xinetd restart
Stopping xinetd: [ OK ]
Starting xinetd: [ OK ]
原文:http://huangzequn.blog.51cto.com/9200401/1766645
内容总结
以上是互联网集市为您收集整理的Centos 日志处理全部内容,希望文章能够帮你解决Centos 日志处理所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。