You installed a new Nagios-Plugin, configured it and tested it on the commandline.
Everything works as expected.
Now you restart Nagios and the output of your website shows only scrap or errors.
In my case it was the default setting in /etc/sudoers
# Refuse to run if unable to disable echo on the tty. This setting should also be
# changed in order to be able to use sudo without a tty. See requiretty above.
which means: sudo need a tty Terminal to run.
Change this setting to : Defaults !requiretty
and your script will run sudo without terminal and the nagios-plugin works perfect.