Problem running script.

I can´t get this script to work when running check_nrpe from nagios server.

Only get NRPE: Unable to read output

Running script directly on server to check works fine.

Am i missing something here ?