워치독 (Watchdog; 감시견)

시스템이 비정상 작동하여 먹통이 된 경우에 그 시스템 스스로 복구하지 못하면, 일정 시간이 지난 후 자동으로 특정 연산을 수행하도록 프로그램된 장치 또는 전자 카드 등을 말한다.

기계장치나 운영체계에 있어 가장 흔한 문제로는 두 개 이상의 부품이나 프로그램이 충돌을 일으켜 교착 상태에 빠져 있는 경우, 또는 운영체계에서 메모리 관리에 문제가 발생했을 경우 등을 들 수 있다. 가끔은 그 시스템 스스로가 정상적인 상태로 복구되는 경우도 있겠지만, 그것이 언제 끝날지 시간을 알 수 없으며 때로 시간이 과도하게 지연되는 수가 발생한다. WDT에는 어떤 프로그램이나 컴퓨터가 가장 최근의 마우스 클릭이나 키보드 입력에 대해 일정 시간 동안 응답을 하지 않으면, 미리 정해진 시간까지만 기다렸다가 시스템을 웜부트하여 재기동 시키도록 프로그래밍 할 수 있다

WDT에는 미리 정해놓은 숫자로부터 일정한 속도로 카운트 다운할 수 있는 디지털 계수기가 달려있으며, 이 카운터의 속도는 클록 회로에 의해 일정하게 유지된다. 만약, 카운터가 "0"에 도달하기 전에 컴퓨터가 복구되면, 원래 하려던 작업을 즉시 수행하도록 지정된 회로에 신호가 보내진다.

sudo apt-get install watchdog
sudo nano /etc/watchdog.conf

시스템 로딩, 핑 메모리 등등 여러가지 조건을 이용하여 모니터링을 할 수 있다.

ping 192.168.0.2

설정

ping                    = 10.30.103.1
interface               = eth0
file                    = /var/log/messages
#change                 = 1407
# Uncomment to enable test. Setting one of these values to '0' disables it.
# These values will hopefully never reboot your machine during normal use
# (if your machine is really hung, the loadavg will go much higher than 25)
#max-load-1             = 24
#max-load-5             = 18
#max-load-15            = 12
# Note that this is the number of pages!
# To get the real size, check how large the pagesize is on your machine.
#min-memory             = 1
#repair-binary          = /usr/sbin/repair
#test-binary            =
#test-timeout           =
watchdog-device = /dev/watchdog
# Defaults compiled into the binary
#temperature-device     =
#max-temperature        = 120
# Defaults compiled into the binary
admin                   = [email protected]
#interval               = 10
#logtick                = 1
# This greatly decreases the chance that watchdog won't be scheduled before
# your machine is really loaded
realtime                = yes
priority                = 1
# Check if syslogd is still running by enabling the following line
#pidfile                = /var/run/syslogd.pid
누구나 수정하실 수 있습니다. 위키 사용법 참고하세요.