Solved

UDP port monitoring

Posted on 2004-10-08
4
836 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
  • 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

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
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 …
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…

831 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