Notification command with rsh

Hello all.
I’m trying to send SMS with an rsh script that send a command to another linux machine with asterisk gsm.
If I execute command by command line all work and SMS is delivered.
If I configure a nagios notification command, when service is down it seems that it doesn’t execute command.
I’ve created (for test purposes) another notification command, that append a text phrase at the end of /var/log/messages, but also this doesn’t work.
Where I’m wrong?
Notification command by emai work properly.

My simple command is

define command{
command_name prova
command_line /bin/echo PROVA >> /var/log/messages
}

and the other is

define command{
command_name notify-exchange
command_line /usr/local/bin/exchange
}

If I execute both command from command line they work…

Thanks
Daniele

are you running them as user root or nagios?
check the permissions on the scripts for the nagios user