On Thu, 25 Nov 1999, John Sanabria wrote:

> Hello:
> 
> I'm developing a project that announce via beeper, when one server is down. e.g.
> 
> ./chckWeb <machine> <port>
> 
> This command, announce at the persons interests in to know if the web site is
> down.
> 
> But i need to extend the program in order to work with DNS,FTP,E-MAIL,and so
> forth.
> 
> I want to know where i can found information that let me know how i can know
> when one service is up?

The simplest, I guess, is to use ps/grep to find out if the relevant
processes are running. But this isn't failsafe, processes can become
malfunctioning but still showing up in ps.

So, I'll give some examples on what I'd do in a homebrew system.

For DNS, try resolving a hostname, ensuring that you use the DNS-server
that you use the server you're checing. Use for example the
"host"-command.

For mail, try contacting port 25 on the host. If it answers, the
mail-server is running. For more advanced test, try sending a mail to
yourself, and have a .forward-file (or similar) which ensures the mail is
specially treated. Have the original process wait for that special
treatment (for example putting it as a named file a particular place).
Make the original process time out after some time, in which case the
mail-server is not working. If the mail-server is working, delete the file
that has been created from the .forward-file, and declare mail to be up.

For ftp, simply try to transfer a file to the ftp-server. If it works, ftp
is running. For more advanced test, try transfer it to the ftp-server,
transfer it back again, and compare it to the original result.

I guess you get my idea.

- Vegard

-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]

Reply via email to