Nagios Exchange
  • Home
  • Directory
  • About

Advanced Search

Build precise queries to find exactly what you need

Search Logic

Select compatible versions

Press ESC to close

Sign In Sign Up

Join our next live webinar: “Advanced Nagios Monitoring Techniques” – Register Now

Plugins4379Themes and Skins11Addons732Documentation283Graphics and Logos36View All Categories
LinuxSecuritySNMPFile SystemCloud
New Listings Recently Updated Listings Most Favored Listings Most Popular Listings Most Rated Listings Most Reviewed Listings
Random Project
Other Tutorials And HOWTOs Installing Nagios: An Enterprise-Worthy Network Monitor
RSS Feed
Newest Listings Updated Listings
Top Contributors
Julien DESMAREST (4)Davide Lemma (4)deskwork_itunes142 (4)Joerg Hoerter (3)TcoUpLoad (1)
See More
Newest Contributors
Community Member (51)Davide Lemma (4)Alarig Le Lay (1)Penn Rabb (1)Sean Falzon (1)
See More
Home > Bill McGonigle
BM

Bill McGonigle

@bill_mcgonigle

User Stats

Favorites0

Views

Projects0

No Projects Found
check_openvpn_pl

patch for OpenVPN2 point-to-point

just a quick note: put something like this in your config file to enable the management interface: management 127.0.0.1 2194 /etc/openvpn/management-password and pass the relevant options in for this probe. (put your password in that named file and get your permissions right!). I'm using OpenVPN 2.2.2 on CentOS 5 in 2012 and I needed to make a few small changes for a point-to-point link (plus a few warning message tweaks). Unified diff follows. Thank you Jamie - using the management interface is the right way to do this (my previous grep hacks were silly). ------------- --- check_openvpn.pl-dist 2012-04-30 18:21:13.000000000 -0400 +++ check_openvpn.pl 2012-04-30 18:45:07.000000000 -0400 @@ -4,6 +4,9 @@ # # Copyright (c) 2007 Jaime Gascon Romero # +# Modified 2012-04-30 Bill McGonigle +# to handle OpenVPN 2 point-to-point connection checking. +# # License Information: # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -28,7 +31,7 @@ use Net::Telnet (); use Getopt::Long qw(:config no_ignore_case); use vars qw($PROGNAME $VERSION); -use lib "/usr/nagios/libexec"; +use lib "/usr/lib/nagios/plugins"; use utils qw(%ERRORS); $PROGNAME = "check_openvpn"; @@ -85,7 +88,7 @@ $t->print($opt_P); } $t->waitfor('/^$/'); -@lines = $t->cmd("status 2"); +@lines = $t->cmd("state"); $t->close; }; @@ -97,7 +100,7 @@ if (defined $opt_i || defined $opt_r) { foreach (@lines) { - if ($_ =~ /CLIENT_LIST,.*,(d+.d+.d+.d+):d+,/) { + if ($_ =~ /d+,CONNECTED,SUCCESS,d+.d+.d+.d+,(d+.d+.d+.d+)/) { push @clients_ip, $1; } } @@ -107,10 +110,10 @@ } elsif (defined $opt_r) { if ( ! grep /b$opt_rb/, @clients_ip) { if (defined $opt_c) { - print "OpenVPN CRITICAL: $opt_r don't found"; + print "OpenVPN CRITICAL: $opt_r not found"; exit $ERRORS{'CRITICAL'}; } else { - print "OpenVPN WARNING: $opt_r don't found"; + print "OpenVPN WARNING: $opt_r not found"; exit $ERRORS{'WARNING'}; } } @@ -128,10 +131,10 @@ if (defined $opt_C) { if ( ! grep /b$opt_Cb/, @clients) { if (defined $opt_c) { - print "OpenVPN CRITICAL: $opt_C don't found"; + print "OpenVPN CRITICAL: $opt_C not found"; exit $ERRORS{'CRITICAL'}; } else { - print "OpenVPN WARNING: $opt_C don't found"; + print "OpenVPN WARNING: $opt_C not found"; exit $ERRORS{'WARNING'}; } }

Reviewed 13 years ago

No Favorites Found

Copyright © 2009-2025 Nagios Enterprises, LLC. All rights reserved.

Privacy PolicyTerms of UseTrademarks