#!/bin/bash # ##################################################### # This is a Nagios plugin that monitors the status # # of services of the SoftEth VPN Server # # # # Version 1.0 # # # # Written by R. Wilgoss 10/12/2019 # ####################################################### /usr/local/vpnserver/vpncmd /TOOLS /CMD check > vpntest.txt status_all=$( cat vpntest.txt ) status=$( grep -r "All checks passed" vpntest.txt | awk '{print $0}' ) if [ "$status" = "All checks passed. It is most likely that SoftEther VPN Server / Bridge can operate normally on this system." ]; then echo "OK - VPN Server Status Operational" awk '/Kernel System/{print;getline;print;}' vpntest.txt awk '/Memory Operation System/{print;getline;print;}' vpntest.txt awk '/Unicode string processing system/{print;getline;print;}' vpntest.txt awk '/File system/{print;getline;print;}' vpntest.txt awk '/Thread processing system/{print;getline;print;}' vpntest.txt awk '/Network system/{print;getline;print;}' vpntest.txt exit 0 else echo "CRITICAL - VPN Server Status Operational Error" awk '/Kernel System/{print;getline;print;}' vpntest.txt awk '/Memory Operation System/{print;getline;print;}' vpntest.txt awk '/Unicode string processing system/{print;getline;print;}' vpntest.txt awk '/File system/{print;getline;print;}' vpntest.txt awk '/Thread processing system/{print;getline;print;}' vpntest.txt awk '/Network system/{print;getline;print;}' vpntest.txt exit 0 fi