Works great through command line…

Has anyone been able to get this to work through the app. I’m able to get this to work fine through the command line, but when running through nagios i get Return Code 255 Out of Bounds. When i run with echo $ at the end on command line i get the same output as if i don’t put it there.

Any help would be greatly appreciated