Solved

UDP port monitoring

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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

757 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now