I’ve got a event handler script, that it calls an another script.
If I execute the first script, with the nagios user, it works (the second script is executed). But if this is executed by Nagios, only runs the first script, but the call to the second script doesn’t work.
Both have the same permisions and the same owner (nagios).
Let’s say these are your definitins. You could redirect the error to some file, let’s say /tmp/event.error by modifying command_line in command definition, like this:
Then let the nagios execute it, and see what is the output in /tmp/event.error
If the script is written with #!/bin/sh, try to turn it into #!/bin/bash. I had the similar problem and it solved it, by turning the script to #!/bin/bash