Answers to: shell script does not run in Nagioshttp://linuxexchange.org/questions/2814/shell-script-does-not-run-in-nagios<p>I have a following issue with Nagios. Here is my command definition:</p> <p>define command{</p> <pre><code>command_name dlg_notifications command_line /usr/local/nagios/libexec/nagios-msg-broker.sh } </code></pre> <p>and service definition</p> <p>define service{</p> <p>use mypc service_description dlg_Alerts_notifications check_command dlg_notifications max_check_attempts 1 retain_status_information 0 retain_nonstatus_information 0 }</p> <p>/bin/bash /usr/local/nagios/libexec/nagios-msg-broker.sh runs fine manually.</p> <p>I can run this script manually, but service defined above can’t run it. Here are the ownership/permissions of the script:</p> <p>perfserver-10:/usr/local/nagios/libexec$ ls -l nagios-msg-broker.sh -rwxrwxrwx 1 nagios nagcmd 149 Mar 30 10:04 nagios-msg-broker.sh</p> <p>Thanks.</p>enMon, 16 Apr 2012 12:32:17 -0400Answer by gmartinhttp://linuxexchange.org/questions/2814/shell-script-does-not-run-in-nagios/2816<p>Have you tried running this as the same user that nagios runs as? Perhaps that user doesn't have a shell defined?</p>gmartinMon, 16 Apr 2012 12:32:17 -0400http://linuxexchange.org/questions/2814/shell-script-does-not-run-in-nagios/2816