Sonar is a simple client/server application that is
used to constantly monitor the health of a specified host system. This application
consists of two separate processes. The server process, sonard, runs continuously
on the machine to be monitored. The client process, sonar, runs continuously on
a (presumedly) separate machine.
Upon startup, the client processes establishes a connection with the server process via
Berkeley-style sockets across TCP/IP. At predefined intervals, the client process will "ping"
the server process. If the server is still "healthy", and the network connection between the
two processes is still valid, then the client will receive an affirmative response from the
server. If the client does not receive a response back from the server within a specified
time period, the client will log the error to a log file.
The figure below displays the basic design of this application.
Figure 1.
Source code: Client,
Server,
Socket Library
|