check_udp | openVPN | --send | --expect

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
steffi
Posts: 25
Joined: Wed Mar 06, 2019 9:43 am

check_udp | openVPN | --send | --expect

Post by steffi »

Hi.
I like to check if my openvpn server is running correctly.
When running check_udp, the script is complaining about a send or a expect String which is missing.
I guess this check is used quite often. Does anybody know what to submit as an argument for --send or --expect?

I tried --expect '1194' based on the following command, but with no success.

Code: Select all

root@fw-2018:~# nc -vz -u localhost 1194
Connection to localhost 1194 port [udp/openvpn] succeeded!
Thanks,
Steffi
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: check_udp | openVPN | --send | --expect

Post by ssax »

What is the output of this command?

Code: Select all

/usr/local/nagios/libexec/check_udp -H OpenVPNIP -p 1194 -s '$38$01$00$00$00$00$00$00$00' -e '' -v
You may want to take a look through these other OpenVPN plugins:

https://exchange.nagios.org/index.php?o ... rd=openvpn
steffi
Posts: 25
Joined: Wed Mar 06, 2019 9:43 am

Re: check_udp | openVPN | --send | --expect

Post by steffi »

Hi.
Thanks for your input. This is the output:

Code: Select all

root@fw-2018:~# /usr/lib/nagios/plugins/check_udp -H 127.0.0.1 -p 1194 -s '$38$01$00$00$00$00$00$00$00' -e '' -v
Using service UDP
Port: 1194
flags: 0x2
Send string: $38$01$00$00$00$00$00$00$00
server_expect_count: 1
        0: 
CRITICAL - Socket timeout after 10 seconds
OpenVPN server is up and running on all ports and working fine.

Thanks,
Steffi
steffi
Posts: 25
Joined: Wed Mar 06, 2019 9:43 am

Re: check_udp | openVPN | --send | --expect

Post by steffi »

Hi.
I switched to this check, which is working fine:
check_udp_port

Thank you for your support.
Steffi
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: check_udp | openVPN | --send | --expect

Post by ssax »

That's great to hear, thanks for the update! Are we okay to lock this up and mark it as resolved?
Locked