check udp port

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
DOkuwa
Posts: 114
Joined: Tue Aug 15, 2017 3:54 pm

check udp port

Post by DOkuwa »

hello
I am checking the specific port 19523 on a red hat Linux server and I am not getting a notification when the port is down by stopping a service
I think the argument is wrong
I am sending the config file and screenshot by attachment

Code: Select all

[/###############################################################################
#
# Service configuration file
#
# Created by: Nagios Core Config Manager 2.6.9
# Date:	      2017-10-18 11:09:07
# Version:    Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND --- 
# Nagios CCM will overwrite all manual settings during the next update if you 
# would like to edit files manually, place them in the 'static' directory or 
# import your configs into the CCM by placing them in the 'import' directory.
#
###############################################################################

define service {
	host_name			dev-smarts-01.exp001.exponential-e.net.
	service_description		dev-te-01
	use				xiwizard_udp_service
	check_command			check_udp!-p 19523 !!!!!!!
	max_check_attempts		5
	check_interval			5
	retry_interval			1
	check_period			xi_timeperiod_24x7
	notification_interval		10
	notification_period		xi_timeperiod_24x7
	contacts			nagiosadmin
	_xiwizard			tcpudpport
	register			1
	}	

###############################################################################
#
# Service configuration file
#
# END OF FILE
#
code]
You do not have the required permissions to view the files attached to this post.
kyang

Re: check udp port

Post by kyang »

The check_udp is going to be expecting a string to pass and receive.

Code: Select all

[-s <send string>]
[-e <expect string>]
If you are just wanting to check the port for a connection then the check_tcp is probably more suitable.

Code: Select all

/usr/local/nagios/libexec/check_tcp -H 192.168.4.125 -p 5666
TCP OK - 0.000 second response time on 192.168.4.125 port 5666|time=0.000410s;;;0.000000;10.000000

Code: Select all

/usr/local/nagios/libexec/check_tcp -H 192.168.4.125 -p 81
connect to address 192.168.4.125 and port 81: No route to host
DOkuwa
Posts: 114
Joined: Tue Aug 15, 2017 3:54 pm

Re: check udp port

Post by DOkuwa »

This worked from the command line
/usr/local/nagios/libexec/check_tcp -H 10.241.11.203 -p 19523
TCP OK - 0.000 second response time on 10.241.11.203 port 19523|time=0.000112s;;;0.000000;10.000000
how does this configured as an alert on Nagios XI windows GUI
please tell me how
kyang

Re: check udp port

Post by kyang »

Like this, I'm only checking my localhost for connection on port 81. It will fail because I don't have port 81 open or any connection.
port.PNG
This is on Port 80, which I do have a connection.
port80.PNG
Here is how I defined my check.
checklocal.PNG
Hope this helps!
You do not have the required permissions to view the files attached to this post.
DOkuwa
Posts: 114
Joined: Tue Aug 15, 2017 3:54 pm

Re: check udp port

Post by DOkuwa »

thanks yes it helps
but also some of the ports are udp
how do we check for this
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: check udp port

Post by dwhitfield »

When you went through the wizard you did not set up a send/expect string.

You may have better luck with the following: https://exchange.nagios.org//directory/ ... rt/details
DOkuwa
Posts: 114
Joined: Tue Aug 15, 2017 3:54 pm

Re: check udp port

Post by DOkuwa »

Code: Select all

 ./check_udp -H 10.241.11.203 -p 19523 -w 60     -s "trap explorer is down" -e "port 19253 is down"
No data received from host
I am not sure why
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: check udp port

Post by dwhitfield »

What's the output of the following command? nmap -sU 10.241.11.203 -p 19523
DOkuwa
Posts: 114
Joined: Tue Aug 15, 2017 3:54 pm

Re: check udp port

Post by DOkuwa »

Thanks

Starting Nmap 6.40 ( http://nmap.org ) at 2017-10-20 09:43 BST
Nmap scan report for dev-smarts-01.exp001.exponential-e.net (10.241.11.203)
Host is up (0.00016s latency).
PORT STATE SERVICE
19523/udp closed unknown
MAC Address: 00:50:56:01:03:24 (VMware)

Nmap done: 1 IP address (1 host up) scanned in 0.07 seconds
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: check udp port

Post by dwhitfield »

DOkuwa wrote: 19523/udp closed unknown
It doesn't look like anything is listening on that port.

What's the output of netstat -lu on that port? Are you sure this is one of the udp ports you need to be checking?
Locked