Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Problem monitoring IPSEC with NRPEv2

    Scheduled Pinned Locked Moved pfSense Packages
    1 Posts 1 Posters 919 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • O
      o1netadmin
      last edited by

      I have created a script to check for the existence of an IPSEC tunnel.  The script works fine from the command line on the pfsense system, even when logged in as the nagios user.  However, when calling it from my Nagios system using check_nrpe it does not work.  It always returns that the tunnel is not found.  This is because the command '/usr/local/sbin/ipsec statusall' does not return any information when it's run through NRPE.  Any ideas on how to fix this?

      Here's my check_ipsec script…

      
      #!/bin/sh
      #
      
      . $PROGPATH/utils.sh
      
      exitstatus=$STATE_WARNING #default
      
      endpoint=$1
      
      result=`/usr/local/sbin/ipsec statusall | grep ESTABLISHED | grep $endpoint`
      if [ "$result" != "" ]
        then
          echo "Ipsec vpn tunnel check ok: $endpoint\n$result\n"
          exitstatus=$STATE_OK
      else
          echo "CRITICAL - Ipsec vpn tunnel not found: $endpoint\n$result\n"
          exitstatus=$STATE_CRITICAL
      fi
      
      exit $exitstatus
      
      
      1 Reply Last reply Reply Quote 0
      • First post
        Last post
      Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.