Build precise queries to find exactly what you need
Press ESC to close
@united-networking
Favorites0
Views
Projects0
Hi, we want to use this script to remotely check VPN tunnels' status, executing this script with NRPE on an IPcop host. But there is no command which in our IPcop v2.1.9, although http://www.cobin.de/binary.php has a locate addon. We therefore replaced "which " with the full paths of files in check_ipcop2.sh. Also, in the scripts function check_connection(), in the line: eroutes=`$IPSECBIN whack --status | grep -e "IPsec SA established" | grep -e "$2" | wc -l` we believe the $2 should actually read $1. With these modifications, we were able to use the script locally: $ /var/ipcop/addons/nrpe/plugins/check_ipsec2_mod.sh -c tunnelname OK - tunnelname Connection is up and running Sadly, the same check done remotely on the Nagios host, with that same commandline above defined for NRPE as command check_tunnelname, does return a different result: /usr/local/nagios/libexec/check_nrpe -H ipcop-hostaddr -c check_tunnelname CRITICAL - tunnelname Connection is down This may only be a user rights problem, as the local test was done as root, but the nrpe service runs as user nagios. But there is no command su or sudo in our IPcop v2.1.9 (hence no /etc/sudoers), and we know of no suitable addon. -- regards, -- United Networking
Reviewed 10 years ago