Page 1 of 1
check_tcp for windows servers
Posted: Wed Apr 19, 2017 11:57 pm
by jyoti22
Hi,
I am trying to monitor the TCP and UDP ports using check_tcp.exe for remote windows machines.
I was able to get the result on command prompt.
C:\Program Files\NSClient++\scripts>check_tcp.exe -H 10.160.0.21 –w 2 –c 3
TCP OK - 0.000 second response time on port 3389 |time=0.000395s
How do I use the same with NSClient and configure on webconsole?
Thanks,
Re: check_tcp for windows servers
Posted: Wed Apr 19, 2017 11:59 pm
by jyoti22
Can I use the check_tcp.exe to check for the UDP ports
Re: check_tcp for windows servers
Posted: Thu Apr 20, 2017 11:33 am
by cdienger
I can't speak too much on how to do it within the web interface as I haven't done it myself and it's a third party application, but
https://docs.nsclient.org/tutorial/#external-scripts covers how to do it via the config files and the nsclient++ forums may help
https://forums.nsclient.org/. Taking a quick look at the web UI though there does appear to be section for setting up external scripts.
check_tcp.exe is used to check tcp ports and cannot check udp. You can always use the TCP/UDP Port wizard within Nagios to configure a check for UDP ports and take out the middleman of using the nsclient++ for this.
Re: check_tcp for windows servers
Posted: Fri Apr 21, 2017 12:13 am
by jyoti22
Thanks,
I used the TCP/UDP monitoring wizard. only TCP port is working.
for UDP I am getting unknown value. Not sure what should be the send and expect string and other values. I just want to check if port is fine like TCP
[
[email protected] libexec]# ./check_udp -H xx.xx.xx.xx -p 68
With UDP checks, a send/expect string must be specified.
Usage:
check_udp -H host -p port [-w <warning time>] [-c <critical time>] [-s <send str ing>]
[-e <expect string>] [-q <quit string>][-m <maximum bytes>] [-d <delay>]
[-t <timeout seconds>] [-r <refuse state>] [-M <mismatch state>] [-v] [-4|-6] [- j]
[-D <warn days cert expire>[,<crit days cert expire>]] [-S <use SSL>] [-E]
[
[email protected] libexec]# ./check_tcp -H xx.xx.xx.xx -p 3389
TCP OK - 0.011 second response time on 10.105.0.251 port 3389|time=0.010783s;;;0 .000000;10.000000
Re: check_tcp for windows servers
Posted: Fri Apr 21, 2017 9:41 am
by cdienger
With the UDP check you must specify a string to send to the destination and an expected response. For example:
Code: Select all
./check_udp -H xx.xx.xx.xx -p 68 -s "SENDSTRING" -e "EXPECTEDRESPONSE"
Re: check_tcp for windows servers
Posted: Mon Apr 24, 2017 7:17 am
by jyoti22
Thanks, But can this be done without the SENDSTRING" and "EXPECTEDRESPONSE"
Re: check_tcp for windows servers
Posted: Mon Apr 24, 2017 9:26 am
by cdienger
It cannot. UDP is a connectionless protocol and the only way to determine if a service is really up and listening would be to send data and get a response in return. With tcp it can be determined that a service is up just by establishing a tcp connection(syn,syn/ack,ack) and then closing the connection(without sending any data).
Re: check_tcp for windows servers
Posted: Tue Apr 25, 2017 2:19 am
by jyoti22
Thanks.. I will check for the sendresponse and expected response and get back to you.
Re: check_tcp for windows servers
Posted: Tue Apr 25, 2017 9:08 am
by cdienger
Sounds good!