Freebsd – nagios nrpe plugin output not complete

freebsdmonitoringnagiosnrpepfsense

I have written a small script to check the states of PfSense, and using this script to get the output in nagios, through NRPE…

Here is the script

used=`pfctl -s state | wc -l | bc | cut -c1-5 | bc`

echo "States consumed=$used"

Normal output of the script is as follows (as it runs on the client.

States consumed=25519

But the issue is that when the same script is ran through NRPE from the nagios server, I get this command.

States consumed=0

But when I put anything in the variable "used" , for example pass it value of 123, or abc,,it is visible on the nagios server through nrpe…
What can be the issue here? I have tried every possible solution from my side, since last 5 days..

Best Answer

Is "pfctl" in the PATH for nagios user? I would use the absolute path in the script.

Related Topic