|
cat /var/log/message
Apr 24 04:05:00 redhat CROND[7607]: (root) CMD ( /usr/share/sshd-monitor/sshd-restarter)
Apr 24 04:05:00 redhat sshd[7612]: Did not receive identification string from ::ffff:127.0.0.1
Apr 24 04:10:00 redhat CROND[7614]: (root) CMD ( /usr/share/sshd-monitor/sshd-restarter)
Apr 24 04:10:00 redhat sshd[7619]: Did not receive identification string from ::ffff:127.0.0.1
Apr 24 04:15:00 redhat CROND[7621]: (root) CMD ( /usr/share/sshd-monitor/sshd-restarter)
...
過五分鍾就一將,全部都是這樣。。。
[root@redhat log]# cat /usr/share/sshd-monitor/sshd-restarter
#!/bin/sh
#---------------------------------------------------------------
# Project : Linux-Mandrake
# Module : sshd-monitor
# File : sshd-restarter
# Version : $Id: sshd-restarter,v 1.2 2002/02/15 04:31:47 flepied Exp $
# Author : Frederic Lepied
# Created On : Tue Jul 3 14:21:12 2001
#---------------------------------------------------------------
if [ -f /var/lock/subsys/sshd ]; then
/usr/share/sshd-monitor/expect-sshd > /dev/null 2>&1
fi
# sshd-restarter ends here
[root@redhat log]# cat /usr/share/sshd-monitor/expect-sshd
#!/usr/bin/expect
#---------------------------------------------------------------
# Project : Linux-Mandrake
# Module : sshd-monitor
# File : expect-sshd
# Version : $Id: expect-sshd,v 1.1.1.1 2001/07/03 14:19:36 flepied Exp $
# Author : Frederic Lepied
# Created On : Tue Jul 3 14:20:15 2001
#---------------------------------------------------------------
# Open SSH connection
spawn telnet localhost 22
# Did we succeed?
expect {
-re ".SSH.*" { send "SSH-1.99-1\r"; exit 0}
timeout
}
overlay /bin/sh -c "/etc/rc.d/init.d/sshd stop; test -r /var/run/sshd.pid && kill -9 `cat /var/run/sshd.pid`; rm -f /var/lock/subsys/sshd /var/run/sshd.pid; /etc/rc.d/init.d/sshd start"
顺便請問一下/var/log/messages.1.gz是如何查看的。。。 |
|