Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Requests and responses for SMTP, FTP, HTTP, POP3, DNS protocols. 1

Status
Not open for further replies.

andsm

Programmer
Nov 26, 2000
3
RU
I want create service monitor to monitor SMTP, FTP, HTTP, POP3, DNS services on remote computers. What is a way to test their status? I read somewhere that to test SMTP
I can send "HELLO name_of_server" and "ok" response is "250 ok" - server will send it if working. Is it right? And what is requests/responses for other services?
 
It depends on what level of monitoring you want to do. A number of the cheaper monitoring services/programs will simply connect to the target server on the default port (SMTP-25, HTTP-80,etc..) and see if a connection is made. If the server accepts the connection, the assumption is made that everything is ok. In 90+% of the cases, this will provide accurate results. There are however a number of cases where a connection is accepted by the service but other problems prevent normal operation. To provide more accurate monitoring for these cases, you'll need to understand the protocol for each service you're requesting. For http, you just need to connect to port 80 and send &quot;GET / HTTP1.0<cflf><cflf>&quot; and see if you get back a normal response code. You'll want to read the RFC's on the services you intend to monitor as they'll outline the messages and response codes so you'll know whether the service is reporting an error or not. Even getting back a normal response code doesn't mean everything is fine. A webserver running a scripting language might report an &quot;OK&quot; response code even though something is preventing the scripting lanuage (ASP,CF,Php3) from running correctly. A mail server might report a normal response although DNS isn't working and it can't resolve any domains or the virtusertable database is corrupt and it can't deliver mail. Once again, it just depends on what level of monitoring you want to do and how much effort you're willing to put into it.

This isn't a trivial application but is certainly something you can do with enough patience. If you have the ability to script a telnet session, this would probably be the easiest. The 2nd easiest method would be to use a scripting language such as Cold Fusion which has the ability to connect to services via TCP/IP with built in functions. Lastly, you could do this in C with regular sockets programming (my favorite).

Good luck,
GJ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top