I am confused. Not that is difficult to get me in a confused state, but I am so confused, that I don't know what my name is or where I live (like Baldrick!).
Anyway, I have nrpe installed on a client and everything works fine from the nagios server. Until I created my own simple plugin.
All it does is read a file from /tmp and echos its one-liner content. Except I get the NRPE: Unable to read output error.
I tried going the sudo route, but that did not work either. I logged in as the nagios user - the owner of the nrpe process - and the plugin works fine then. But executing it from the nagios server does not work.
In the end, I moved the file from /tmp to /usr/lib/nagios/plugins/logs and now it works from the nagios server.
So, my question is, how does ubuntu limit the plugin to /usr/lib/nagios/plugins when the script is being executed from the nagios server, but when logged in locally as the nagios user, it has access to the file in /tmp?