Discussion:
[Nagios-users] check_udp error message
Marco Borsani
2013-09-03 10:33:07 UTC
Permalink
Hi all

I need to control many UDP ports.



I run the command:

./check_udp –H <IP_ADDRESS> –p 88



I receive following error message (with state UNKNOWN) :

With UDP checks, a send/expect string must be specified



Can anyone help me to solve it?

Those parameters should be optional..



regards



Marco Borsani

Unix and Monitoring Sysadmin

Business Unit Internet Solutions - Operations

tel: +39 010 4310115

fax: +39 02 30130311

cell: +39 329 5953944

ITnet S.r.l.

Società con socio unico

Soggetta a direzione e coordinamento di Italiaonline S.r.l.
Andreas Ericsson
2013-09-03 13:53:36 UTC
Permalink
Post by Marco Borsani
Hi all
I need to control many UDP ports.
./check_udp –H <IP_ADDRESS> –p 88
With UDP checks, a send/expect string must be specified
Can anyone help me to solve it?
Those parameters should be optional..
UDP is a connection-less protocol. The "expect" string could indeed
be optional, and we could just expect to get something at all back
when we send something, but without sending anything we won't even
touch the network, so the remote host has no idea that we're trying
to talk to it and we won't know if the port is up.

That's why "send", at least, is not optional.
--
Andreas Ericsson ***@op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.
Marco Borsani
2013-09-05 07:06:38 UTC
Permalink
Ok, but what can I "send" and "receive" to/from the host?

I also tried old version of check_udp (that does not need any string), but I
read :
No data was recieved from host!
No response from host on port XX

Or simply:
No response from host on port XX

I see another strange situation.
On port 161 I can use check_snmp (work correctly), but if I use check_udp on
port 161 it does not work at all !
How can be possible ?

Regards

-----Messaggio originale-----
Da: Andreas Ericsson [mailto:***@op5.se]
Inviato: martedì 3 settembre 2013 15:54
A: Nagios Users List
Cc: Marco Borsani
Oggetto: Re: [Nagios-users] check_udp error message
Post by Marco Borsani
Hi all
I need to control many UDP ports.
./check_udp –H <IP_ADDRESS> –p 88
With UDP checks, a send/expect string must be specified
Can anyone help me to solve it?
Those parameters should be optional..
UDP is a connection-less protocol. The "expect" string could indeed be
optional, and we could just expect to get something at all back when we send
something, but without sending anything we won't even touch the network, so
the remote host has no idea that we're trying to talk to it and we won't
know if the port is up.

That's why "send", at least, is not optional.
--
Andreas Ericsson ***@op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and terror,
I think we should give some serious thought to declaring war on peace.
frank
2013-09-05 18:23:52 UTC
Permalink
You need to send a message that the listening daemon will understand. The
check_snmp plugin speaks the SNMP language so it knows how to construct a
packet that snmpd will understand. I imagine an OID is a requirement for
check_snmp, as well as community string or security credentials, those are
all part of the "send". If you want to use check_udp for this, then you
have to construct that packet yourself.

On the flip-side, you should know the expected response to a known query.
If you make an SNMP request for .1.3.6.1.2.1.1.4.0 you should expect a
string from the "syscontact" line from your snmpd.conf in response.

Just like you would use check_http rather than check_tcp for an Apache
service, it's probably best to use a custom program like check_dns rather
than check_udp to check a DNS service. In the case of SNMP, I prefer to
use or write scripts that are specific to what I'm polling rather than
using a generic request/response program. For instance, a program like
check_snmp_load.pl could be alot more robust than running "check_snmp -o
.1.3.6.1.4.1.2021.10.1.3.1" alone.

-f
Date: Thu, 5 Sep 2013 09:06:38 +0200
Subject: [Nagios-users] R: check_udp error message
Ok, but what can I "send" and "receive" to/from the host?
I also tried old version of check_udp (that does not need any string), but I
No data was recieved from host!
No response from host on port XX
No response from host on port XX
I see another strange situation.
On port 161 I can use check_snmp (work correctly), but if I use check_udp on
port 161 it does not work at all !
How can be possible ?
Regards
-----Messaggio originale-----
Inviato: marted? 3 settembre 2013 15:54
A: Nagios Users List
Cc: Marco Borsani
Oggetto: Re: [Nagios-users] check_udp error message
Post by Marco Borsani
Hi all
I need to control many UDP ports.
./check_udp ?H <IP_ADDRESS> ?p 88
With UDP checks, a send/expect string must be specified
Can anyone help me to solve it?
Those parameters should be optional..
UDP is a connection-less protocol. The "expect" string could indeed be
optional, and we could just expect to get something at all back when we send
something, but without sending anything we won't even touch the network, so
the remote host has no idea that we're trying to talk to it and we won't
know if the port is up.
That's why "send", at least, is not optional.
Marco Borsani
2013-09-06 06:19:37 UTC
Permalink
I have not any idea how to construct a packet to send/receive...I did not
thing was necessary to use that plugin......
Roger Bell_West
2013-09-06 08:08:23 UTC
Permalink
Post by Marco Borsani
I have not any idea how to construct a packet to send/receive...I did not
thing was necessary to use that plugin......
Try reading https://en.wikipedia.org/wiki/User_Datagram_Protocol since
you clearly don't understand UDP. You are still suffering from the
same conceptual error as in your original post, even though several
kind people have explained the problem. There's no point in us telling
you the answer again if you aren't equipped to make sense of it.

R
Marco Borsani
2013-09-06 11:44:06 UTC
Permalink
I already have read that wiki...

But one of the main point is (as I wrote in the last mail):
Roger Bell_West
2013-09-06 12:07:15 UTC
Permalink
Post by Marco Borsani
I already have read that wiki...
OK, I'll try to explain in a different way.

With a TCP-based service there's a standard handshake. You send a SYN,
you get a SYN+ACK, you send an ACK; if that happens, the TCP port is
open. (It may not be responding in a useful way, but it is at least
accepting connections.) So check_tcp doesn't need anything more than
an address and port number to be a useful generic monitor.

With UDP there is no handshaking except what's defined in the
application layer. If you send something that's not what the listening
server expects, the response you get could be an error or could be
nothing at all; it's entirely up to the listening server. The concept
of an "open UDP port" is not really very meaningful in itself. You can
check that you don't get an ICMP Port Unreachable when you send random
junk to the port (I assume that's what the old check_udp is doing;
I've never used it), but there are lots of reasons you might not get
that packet back, including firewall policies; it's no sort of
reliable test.

So your UDP service, of which you still refuse to give any detail, is
expecting something and will return something else. You need to send
it that something, and look for the something else in the response --
just as you send a URL and look for body text when you're using
check_http.

Roger

Loading...