diff --git a/check_ipsec/Makefile b/check_ipsec/Makefile deleted file mode 100644 index cf9673d..0000000 --- a/check_ipsec/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -#/usr/bin/make -f - -include ../common.mk diff --git a/check_ipsec/check_ipsec b/check_ipsec/check_ipsec deleted file mode 100644 index 29834df..0000000 --- a/check_ipsec/check_ipsec +++ /dev/null @@ -1,194 +0,0 @@ -#!/bin/bash -# Written By Nicole -# Any Comments or Questions please e-mail to ml@nicole-haehnel.de -# -# Plugin Name: check_ipsec -# Version: 2.0 -# Date: 26/08/2008 -# -# Usage: check_ipsec --tunnels -# -# gateways.txt file must be located in same directory -# and has to look like: -# nameofconn1 192.168.0.1 -# nameofconn2 192.168.1.1 -# -# ------------Defining Variables------------ -PROGNAME=`basename $0` -PROGPATH=`echo $0 | sed -e 's,[\\/][^\\/][^\\/]*$,,'` -REVISION=`echo '$Revision: 2.0 $' | sed -e 's/[^0-9.]//g'` -#STRONG=`$IPSECBIN --version |grep strongSwan | wc -l` -DOWN="" -# ---------- Change to your needs ---------- -PLUGINPATH="/usr/lib64/nagios/plugins" -GATEWAYLIST="gateways.txt" -IPSECBIN="/usr/sbin/ipsec" -FPINGBIN="/usr/sbin/fping" -# ping server in network on the other side of the tunnel -PINGIP=1 # ping yes or no (1/0) -# ------------------------------------------ - -. $PROGPATH/utils.sh - - -# Testing availability of $IPSECBIN, $FPINGBIN and $GATEWAYLIST - -if [ $# -eq 0 ]; -then - echo UNKNOWN - missing Arguments. Run check_ipsec --help - exit $STATE_UNKNOWN -fi - -test -e $IPSECBIN -if [ $? -ne 0 ]; -then - echo CRITICAL - $IPSECBIN not exist - exit $STATE_CRITICAL -else - STRONG=`$IPSECBIN --version |grep strongSwan | wc -l` -fi - -if [ $PINGIP -eq 1 ] -then - test -e $FPINGBIN - if [ $? -ne 0 ]; - then - echo CRITICAL - $FPINGBIN not exist - exit $STATE_CRITICAL - fi -fi - -test -e $PROGPATH/$GATEWAYLIST -if [ $? -ne 0 ]; -then - echo CRITICAL - $GATEWAYLIST not exist - exit $STATE_CRITICAL -fi - -print_usage() { - echo "Usage:" - echo " $PROGNAME --tunnels " - echo " $PROGNAME --help" - echo " $PROGNAME --version" - echo " Created by Nicole, questions or problems e-mail ml@nicole-haehnel.de" - echo "" -} - -print_help() { - print_revision $PROGNAME $REVISION - echo "" - print_usage - echo " Checks vpn connection status of an openswan or strongswan installation." - echo "" - echo " --tunnels " - echo " -T " - echo " provides the tunnel status of the openswan or strongswan installation" - echo "" - echo " --help" - echo " -h" - echo " prints this help screen" - echo "" - echo " --version" - echo " -V" - echo " Print version and license information" - echo "" -} - -check_tunnel() { - - if [[ "$STRONG" -eq "1" ]] - then - eroutes=`$IPSECBIN status | grep -e "IPsec SA established" | grep -e "newest IPSEC" | wc -l` - else - eroutes=`$IPSECBIN whack --status | grep -e "IPsec SA established" | grep -e "newest IPSEC" | wc -l` - fi - - - if [[ "$eroutes" -eq "$2" ]] - then - echo "OK - All $2 tunnels are up an running" - exit $STATE_OK - elif [[ "$eroutes" -gt "$2" ]] - then - echo "WARNING - More than $2 ($eroutes) tunnels are up an running" - exit $STATE_WARNING - else - echo "CRITICAL - Only $eroutes tunnels from $2 are up an running - $(location)" - exit $STATE_CRITICAL - fi -} - - -location() { - -count=0 -i=1 - -while read line; do - - CONN=`echo $line| awk '{print $1}'` - IP=`echo $line| awk '{print $2}'` - - if [[ "$STRONG" -eq "1" ]] - then - tunneltest=`$IPSECBIN status | grep -e "IPsec SA established" | grep -e "newest IPSEC" |grep -e $CONN | wc -l` - else - tunneltest=`$IPSECBIN whack --status | grep -e "IPsec SA established" | grep -e "newest IPSEC" |grep -e "$CONN" | wc -l` - fi - - if [[ "$tunneltest" -eq "0" ]] - then - count=$[$count+1] - DOWN="$DOWN $CONN" - fi - - if [[ "$PINGIP" -eq "1" && "$tunneltest" -eq "1" ]] - then - alive=`$FPINGBIN $IP -r 1 | grep alive | wc -l` - - if [[ "$alive" -eq "0" ]] - then - count=$[$count+1] - DOWN="$DOWN $CONN (no ping)" - fi - fi - - -i=$[$i+1] - -done < $PLUGINPATH/$GATEWAYLIST - -echo $DOWN - -} - - -case "$1" in ---help) - print_help - exit $STATE_OK - ;; --h) - print_help - exit $STATE_OK - ;; ---version) - print_revision $PLUGIN $REVISION - exit $STATE_OK - ;; --V) - print_revision $PLUGIN $REVISION - exit $STATE_OK - ;; ---tunnels) - check_tunnel $1 $2 - ;; --T) - check_tunnel $1 $2 - ;; -*) - print_help - exit $STATE_OK - -esac - diff --git a/check_ipsec/control b/check_ipsec/control deleted file mode 100644 index 5313784..0000000 --- a/check_ipsec/control +++ /dev/null @@ -1,6 +0,0 @@ -Homepage: https://raw.githubusercontent.com/Inuits/monitoring-plugins/master/check_ipsec -Watch: https://raw.githubusercontent.com/Inuits/monitoring-plugins/master/check_ipsec # Version: ([0-9.]+) -Recommends: monitoring-plugins-common | nagios-plugins-common, fping, strongswan-starter | openswan -Version: 2.0 -Uploaders: Jan Wagner -Description: plugin checking ipsec connections from open- or stongswan diff --git a/check_ipsec/copyright b/check_ipsec/copyright deleted file mode 100644 index 78f7ab5..0000000 --- a/check_ipsec/copyright +++ /dev/null @@ -1,7 +0,0 @@ -Copyright (c) 2008 ml@nicole-haehnel.de - -License: N/A - - On Debian systems, the complete text of the GNU General - Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". - diff --git a/debian/README.Debian.plugins b/debian/README.Debian.plugins index 155aca6..3edef2f 100644 --- a/debian/README.Debian.plugins +++ b/debian/README.Debian.plugins @@ -31,9 +31,6 @@ check_iostat: check_iostats: Required Packages: sysstat -check_ipsec: - Required Packages: monitoring-plugins-common | nagios-plugins-common, fping, strongswan-starter | openswan - check_mysql_slave: Required Packages: libdbd-mysql-perl diff --git a/debian/patches/check_ipsec/10_pathes b/debian/patches/check_ipsec/10_pathes deleted file mode 100644 index 5f169ee..0000000 --- a/debian/patches/check_ipsec/10_pathes +++ /dev/null @@ -1,27 +0,0 @@ -Author: Jan Wagner -Description: - Patches check_ipsec to use debian specific paths. - -diff --git a/check_ipsec/check_ipsec b/check_ipsec/check_ipsec -index 29834df..084e6ee 100644 ---- a/check_ipsec/check_ipsec -+++ b/check_ipsec/check_ipsec -@@ -20,15 +20,15 @@ REVISION=`echo '$Revision: 2.0 $' | sed -e 's/[^0-9.]//g'` - #STRONG=`$IPSECBIN --version |grep strongSwan | wc -l` - DOWN="" - # ---------- Change to your needs ---------- --PLUGINPATH="/usr/lib64/nagios/plugins" -+PLUGINPATH="/usr/lib/nagios/plugins" - GATEWAYLIST="gateways.txt" - IPSECBIN="/usr/sbin/ipsec" --FPINGBIN="/usr/sbin/fping" -+FPINGBIN="/usr/bin/fping" - # ping server in network on the other side of the tunnel - PINGIP=1 # ping yes or no (1/0) - # ------------------------------------------ - --. $PROGPATH/utils.sh -+. $PLUGINPATH/utils.sh - - - # Testing availability of $IPSECBIN, $FPINGBIN and $GATEWAYLIST diff --git a/debian/patches/check_ipsec/15_fix_syntax b/debian/patches/check_ipsec/15_fix_syntax deleted file mode 100644 index c1d2c8f..0000000 --- a/debian/patches/check_ipsec/15_fix_syntax +++ /dev/null @@ -1,71 +0,0 @@ -Author: Jan Wagner -Description: - Patches check_ipsec to fix syntax issues - -diff --git a/check_ipsec/check_ipsec b/check_ipsec/check_ipsec -index 29834df..084e6ee 100644 ---- a/check_ipsec/check_ipsec -+++ b/check_ipsec/check_ipsec -@@ -96,7 +96,7 @@ print_help() { - - check_tunnel() { - -- if [[ "$STRONG" -eq "1" ]] -+ if [ "$STRONG" -eq "1" ] - then - eroutes=`$IPSECBIN status | grep -e "IPsec SA established" | grep -e "newest IPSEC" | wc -l` - else -@@ -104,21 +104,21 @@ check_tunnel() { - fi - - -- if [[ "$eroutes" -eq "$2" ]] -+ if [ "$eroutes" -eq "$2" ] - then - echo "OK - All $2 tunnels are up an running" - exit $STATE_OK -- elif [[ "$eroutes" -gt "$2" ]] -+ elif [ "$eroutes" -gt "$2" ] - then - echo "WARNING - More than $2 ($eroutes) tunnels are up an running" - exit $STATE_WARNING - else - echo "CRITICAL - Only $eroutes tunnels from $2 are up an running - $(location)" -+ location - exit $STATE_CRITICAL - fi - } - -- - location() { - - count=0 -@@ -129,24 +129,24 @@ while read line; do - CONN=`echo $line| awk '{print $1}'` - IP=`echo $line| awk '{print $2}'` - -- if [[ "$STRONG" -eq "1" ]] -+ if [ "$STRONG" -eq "1" ] - then - tunneltest=`$IPSECBIN status | grep -e "IPsec SA established" | grep -e "newest IPSEC" |grep -e $CONN | wc -l` - else - tunneltest=`$IPSECBIN whack --status | grep -e "IPsec SA established" | grep -e "newest IPSEC" |grep -e "$CONN" | wc -l` - fi - -- if [[ "$tunneltest" -eq "0" ]] -+ if [ "$tunneltest" -eq "0" ] - then - count=$[$count+1] - DOWN="$DOWN $CONN" - fi - -- if [[ "$PINGIP" -eq "1" && "$tunneltest" -eq "1" ]] -+ if [ "$PINGIP" -eq "1" && "$tunneltest" -eq "1" ] - then - alive=`$FPINGBIN $IP -r 1 | grep alive | wc -l` - -- if [[ "$alive" -eq "0" ]] -+ if [ "$alive" -eq "0" ] - then - count=$[$count+1] - DOWN="$DOWN $CONN (no ping)" diff --git a/debian/patches/check_ipsec/20_remove_gateway b/debian/patches/check_ipsec/20_remove_gateway deleted file mode 100644 index 17f938a..0000000 --- a/debian/patches/check_ipsec/20_remove_gateway +++ /dev/null @@ -1,27 +0,0 @@ ---- a/check_ipsec/check_ipsec -+++ b/check_ipsec/check_ipsec -@@ -61,8 +61,7 @@ - test -e $PROGPATH/$GATEWAYLIST - if [ $? -ne 0 ]; - then -- echo CRITICAL - $GATEWAYLIST not exist -- exit $STATE_CRITICAL -+ USEGATEWAYS="0" - fi - - print_usage() { -@@ -113,8 +112,12 @@ - echo "WARNING - More than $2 ($eroutes) tunnels are up an running" - exit $STATE_WARNING - else -- echo "CRITICAL - Only $eroutes tunnels from $2 are up an running - $(location)" -- location -+ if [ "$USEGATEWAYS" -eq "0" ] -+ then -+ echo "CRITICAL - Only $eroutes tunnels from $2 are up an running" -+ else -+ echo "CRITICAL - Only $eroutes tunnels from $2 are up an running - $(location)" -+ fi - exit $STATE_CRITICAL - fi - } diff --git a/debian/patches/series b/debian/patches/series index efb5871..b98d2e9 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,8 +1,5 @@ check_apache_balancer_members/NagiosPlugins check_apache_balancer_members/epn -check_ipsec/10_pathes -check_ipsec/15_fix_syntax -check_ipsec/20_remove_gateway check_mysql_slave//epn check_nextcloud/shebang check_sieve/epn