溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

Centos 日志處理

發(fā)布時(shí)間:2020-07-09 19:02:41 來(lái)源:網(wǎng)絡(luò) 閱讀:1041 作者:hzq601498281 欄目:移動(dòng)開發(fā)

今天檢查系統(tǒng)日志發(fā)現(xiàn)有,日志中都是以下格式的日志:

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)

 

通過(guò)分析以上日志發(fā)現(xiàn):

xinetd是新一代的網(wǎng)絡(luò)守護(hù)進(jìn)程服務(wù)程序,又叫超級(jí)Internet服務(wù)器,常用來(lái)管理多種輕量級(jí)Internet服務(wù)。

這個(gè)進(jìn)程來(lái)自于192.168.1.60這個(gè)ip,明顯是內(nèi)網(wǎng)ip,以前沒有發(fā)現(xiàn)這個(gè)問(wèn)題,奇怪。

60這臺(tái)服務(wù)器查看發(fā)現(xiàn),有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是一款開源的免費(fèi)網(wǎng)絡(luò)監(jiān)視工具,能有效監(jiān)控Windows、LinuxUnix的主機(jī)狀態(tài)、交換機(jī)、路由器等網(wǎng)絡(luò)設(shè)置,打印機(jī)等。

Nagios 可以監(jiān)控的功能有: 

1、監(jiān)控網(wǎng)絡(luò)服務(wù)(SMTP、POP3、HTTP、NNTP、PING等);

2、監(jiān)控主機(jī)資源(處理器負(fù)荷、磁盤利用率等);

3、簡(jiǎn)單地插件設(shè)計(jì)使得用戶可以方便地?cái)U(kuò)展自己服務(wù)的檢測(cè)方法;

4、并行服務(wù)檢查機(jī)制;

5、具備定義網(wǎng)絡(luò)分層結(jié)構(gòu)的能力,用"parent"主機(jī)定義來(lái)表達(dá)網(wǎng)絡(luò)主機(jī)間的關(guān)系,這種關(guān)系可被用來(lái)發(fā)現(xiàn)和明晰主機(jī)宕機(jī)或不可達(dá)狀態(tài);

6、當(dāng)服務(wù)或主機(jī)問(wèn)題產(chǎn)生與解決時(shí)將告警發(fā)送給聯(lián)系人(通過(guò)EMail、短信、用戶定義方式);

7、具備定義事件句柄功能,它可以在主機(jī)或服務(wù)的事件發(fā)生時(shí)獲取更多問(wèn)題定位;

8、自動(dòng)的日志回滾;

9、可以支持并實(shí)現(xiàn)對(duì)主機(jī)的冗余監(jiān)控;

10、可選的WEB界面用于查看當(dāng)前的網(wǎng)絡(luò)狀態(tài)、通知和故障歷史、日志文件等;

 

查看nagios進(jìn)程發(fā)現(xiàn),有多個(gè)進(jìn)程

[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服務(wù)在xinetd下的日志輸出

修改配置文件,禁用成功狀態(tài)下的日志

 

[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

 

重新服務(wù)xinetd后再次查看日志,不再出現(xiàn)nrpe相關(guān)日志

[root@jsmapp3 tomcat]# service xinetd restart

Stopping xinetd: [  OK  ]

Starting xinetd: [  OK  ]


向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI