Solved

UDP port monitoring

Posted on 2004-10-08
4
839 Views
Last Modified: 2008-03-10
I would like to build a simple program that will monitor different UDP ports on a number of servers I have employed.  I want the program to be run as a cronjob, and notify me of any downs that it detects.

The problem I'm having is getting a guarenteed UDP response when I need to detect if the port is responding or not.

 Do I need to setup a UDP client for each server that I expect to be on that port?   Or is there a guarenteed way to receive a UDP response indicating that there is a server responding on said port?  The types of UDP applications that I can expect to monitor are:

DNS server
Half Life/Counter Strike server
Team Speak server
echo server
daytime server

Thank you for your help.
0
Comment
Question by:vancetech
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 18

Accepted Solution

by:
kandura earned 125 total points
ID: 12264625
Have you considered using nmap?

    nmap -sU -p 53 localhost

works nicely on my dns server.
It can take a list of ports after the -p, and a list of hosts.
0
 

Author Comment

by:vancetech
ID: 12264689
I was hoping to use just default Perl modules to avoid any portability or re-installation work that would need to be done.  By default I don't have nmap installed on my linux system.

Thank you for that suggestion.
0
 

Author Comment

by:vancetech
ID: 12264708
nmap does has an interesting description of UDP port monitoring that may be useful:

UDP scans: This method is used to determine which UDP (User Datagram Protocol, RFC 768) ports  are  open
              on  a  host.   The  technique  is  to send 0 byte udp packets to each port on the target machine.  If we
              receive an ICMP port unreachable message, then the port is closed.  Otherwise we assume it is open.
0
 
LVL 18

Expert Comment

by:kandura
ID: 12264720
heh :)

You saved me from having to dive into IO::Socket::INET and udp, phew!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question