PFSense 2.8 CE :: NRPE not providing correct status of services
-
Hi Team,
After upgrading to PfSense 2.8 CE, I am experiencing an issue retrieving the correct status of services via NRPE.
For testing, I ran the following command manually:
./check_pf_services -name openvpn
The response returned was:
CRITICAL - openvpn service not running
However, the OpenVPN service is actually running. I’m also monitoring the PfSense services through OMD Thruk using the check_nrpe plugin, and it is returning the same (incorrect) result.
Could you please confirm if there have been any changes in the location of service status data or any modifications to service names in this release?
For reference, the script I’m using to check service status is:
check_pf_services
#!/bin/sh if [ "$1" = "-name" ] && [ ! -z "$2" ]; then NAME=$2 OPTION3=$3 OPTION4=$4 if [ "$NAME" = "pinger" ]; then if [ -f /usr/local/bin/dpinger ]; then CHECK=$(/usr/local/sbin/pfSsh.php playback svc status dpinger $OPTION3 $OPTION4 |grep 'running' |wc -l | sed -e 's/^[ \t]*//')||exit 3 NAME="d"$NAME else CHECK=$(/usr/local/sbin/pfSsh.php playback svc status apinger $OPTION3 $OPTION4 |grep 'running' |wc -l | sed -e 's/^[ \t]*//')||exit 3 NAME="a"$NAME fi #CHECK=`expr $CHECK1 + $CHECK2` else CHECK=$(/usr/local/sbin/pfSsh.php playback svc status $NAME $OPTION3 $OPTION4 |grep 'running' |wc -l | sed -e 's/^[ \t]*//')||exit 3 fi #CHECK=$(/usr/local/sbin/pfSsh.php playback svc status $NAME)||exit 3 #echo "DEBUG: NAME:$NAME CHECK:$CHECK" if [ $CHECK -lt 1 ];then echo "CRITICAL - $NAME service not running" exit 2 else echo "OK - $NAME service is running" exit 0 fi else echo "check_pf_services.sh - Nagios Plugin for checking services on pfSense " echo "" echo "Usage: check_pf_services.sh -name <service_name>" echo " " echo "Note: If captiveportal is the service getting checked, the zone name" echo " in all lowercase must follow the service_name parameter" echo "Example: check_pf_services.sh -name captiveportal guest" echo " " echo "Note: If openvpn is the service getting checked, two options must be" echo " specified -- the option "server" followed by the server id." echo "Example: check_pf_services.sh -name openvpn server 1" echo " " echo "Note: Specifying 'pinger' as the service will check both apinger" echo " as well as dpinger. You can specify directly as well." echo "Example: check_pf_services.sh -name pinger" exit 3 fi
Looking forward to your input.
Thanks -
Did you pass the required options to it? It expects to see mode and ID:
[2.8.0-RELEASE][admin@t70.stevew.lan]/root: pfSsh.php playback svc status openvpn Invalid OpenVPN mode (server, client) [2.8.0-RELEASE][admin@t70.stevew.lan]/root: pfSsh.php playback svc status openvpn server Invalid OpenVPN ID, must be numeric [2.8.0-RELEASE][admin@t70.stevew.lan]/root: pfSsh.php playback svc status openvpn server 1 Service openvpn is running.
Like it shows in the example in the script.
-
@stephenw10 Yes. I tried and it showing service not running.
[2.8.0-RELEASE][santheerdas@xxxx]/usr/local/libexec/nagios: ./check_pf_services -name openvpn server 1 CRITICAL - openvpn service not running [2.8.0-RELEASE][santheerdas@xxxx]/usr/local/libexec/nagios: ./check_pf_services -name "openvpn server 1" CRITICAL - openvpn server 1 service not running [2.8.0-RELEASE][santheerdas@xxxx]/usr/local/libexec/nagios: ./check_pf_services -name "openvpn client 1" CRITICAL - openvpn client 1 service not running [2.8.0-RELEASE][santheerdas@xxxx]/usr/local/libexec/nagios: ./check_pf_services -name "nrpe" CRITICAL - nrpe service not running [2.8.0-RELEASE][santheerdas@xxxx]/usr/local/libexec/nagios: ./check_pf_services -name ipsec CRITICAL - ipsec service not running
-
@stephenw10 ok.when using the pfSsh.php, it is working. Ok Thanks. let me try to update the script check_pf_services.
[2.8.0-RELEASE][santheerdas@XXX]/home/santheerdas: sudo pfSsh.php playback svc status openvpn server 1 Password: Service openvpn is running. [2.8.0-RELEASE][santheerdas@XXX]/home/santheerdas: sudo pfSsh.php playback svc status nrpe Service nrpe is running. [2.8.0-RELEASE][santheerdas@XXX]/home/santheerdas: