Customized Script not running


I have created my own shell script and want to schedule the same through Nagios as notification. I have added proper entries in command.cfg and templates.cfg but still the things are not working.

Can you please suggest how I can make that notification run ?

Nagios is version 3.2 on linux machine



Could you post the entries you added in command.cfg, templates.cfg …etc
anything that may help us to help you


define command{
command_name test-notify
command_line /usr/bin/

service_notification_commands notify-service-by-email,test-notify ; send service notifications via email
host_notification_commands notify-host-by-email,test-notify ; send host notifications via email script has:
touch /root/gautam/new.txt



and could you post the service definition ?


I have not changed anything else. Please suggest where all I have to make changes ?



Normally it is good practice to keep all of your check/notify scripts in one place, generally the nagios/libexec folder. If you look at other scripts in there you will see they are generally owned by the nagios user & group, which have permissions to run the script, like
-rwxr-xr-x 1 nagios nagios …
Are the permissions on as above?