Program Design Document
User guide
I want to write a DNS monitor program. This program will
contain a
lot of my thinking about how applications ought to be written. It
will
have:
I googoled "DNS monitor" and I found a
page on SiteScope which can do the DNS monitoring, jabber
alert and jabber monitor (an open source implementation of the jabber protocol),
intermapper,
there is a DNS monitoring
tool available at SimpleDNS.com.
So I don't find an open source DNS monitoring solution. Since
sitescope can do DNS monitoring, Real Networks will probably use
that.
But I could still do it as an open source project and release it to the
world.
I assume that I am going to do the original version as a perl
script. My road map is:
| Version |
Features |
| 0.0 |
Configuration file, monitoring
capability, send E-mail when something goes wrong |
| 1.0 |
A command line interface at
startup which includes options for everything in the configuration file
plus a daemon flag and a debug flag |
| 1.1 |
readwrite state file |
| 1.2 |
Sense when the nameservers
disagree about a host |
| 1.3 |
Logging via the syslog facility |
| 2.0 |
A control/status port which uses TCP/IP |
| 2.1 |
A command line contral/status interface, suitable for scripting |
| 2.2 |
A status interface which uses
VT100 graphics to display the state of the system |
| 2.2 |
A browser interface |
| 2.3 |
An X-windows interface |
| 3.0 | SNMP intrerface |
| 4.0 |
rewrite in C |
parse arguments
real configuration file and build host list and ns list
bind to command/status tcp port # version 2.0
change EUID/EGID
fork SNMP interface
# version 3.0
fork command/status handler # version 2.0
foreach host in hostlist
foreach ns in nslist[host]
status = green
set alarm
start timer
if host is dotted quad then
ip_name = reverse_query (host, ns)
else
ip_addr = query ( host, ns )
endif
if alarm timeout then status = red
if time exceeds threshold then status = orange
if answer is wrong then status =
yellow # version 1.2
change state to reflect status
# version 1.1
if status != green and state is green or
status == green and state is not
green then log using syslog # version 1.3
done
done
The command/status port thread (version 2.0):
do forever
listen on command/status port
wait for connection
fork a connection handler
done
connection handler