?
Solved

UDP port monitoring

Posted on 2004-10-08
4
Medium Priority
?
841 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 375 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

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.…
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…
Six Sigma Control Plans

719 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