Page 1 of 1

Not able to run the shell script from nagios web UI.

Posted: Thu Jul 21, 2016 9:17 am
by steelwedge
Dear Team,

We are able to run the shell script from putty and getting the output, if we run the same from nagios web UI we are getting the following message. PFA shell script file, please check it and do the needful.

Command Line output:
[root@swnagios libexec]# /usr/local/nagios/libexec/check_exception_in_impala.sh http://10.128.50.17:25000/queries
no queries are running in exceptions in http://10.128.50.17:25000/queries

Nagios Web UI output :

Code: Select all

COMMAND: /usr/local/nagios/libexec/check_exception_in_impala.sh http://10.128.50.17:25000/queries
OUTPUT: BASH=/bin/sh
BASHOPTS=cmdhist:extquote:force_fignore:hostcomplete:interactive_comments:progcomp:promptvars:sourcepath
BASH_ALIASES=()
BASH_ARGC=([0]="1")
BASH_ARGV=([0]="http://10.128.50.17:25000/queries")
BASH_CMDS=()
BASH_LINENO=([0]="0")
BASH_SOURCE=([0]="/usr/local/nagios/libexec/check_exception_in_impala.sh")
BASH_VERSINFO=([0]="4" [1]="1" [2]="2" [3]="1" [4]="release" [5]="x86_64-redhat-linux-gnu")
BASH_VERSION='4.1.2(1)-release'
DATA=
DIRSTACK=()
EUID=48
GROUPS=()
HOST=http://10.128.50.17:25000/queries
HOSTNAME=swnagios.mgmt.steelwedge.com
HOSTTYPE=x86_64
IFS='
'
JAVA_HOME=/opt/jdk1.7.0_75
KRB5RCACHETYPE=none
LANG=en_US
MACHTYPE=x86_64-redhat-linux-gnu
OPTERR=1
OPTIND=1
OSTYPE=linux-gnu
PATH=/sbin:/usr/sbin:/bin:/usr/bin
PIPESTATUS=([0]="1")
POSIXLY_CORRECT=y
PPID=23717
PS4='+ '
PWD=/usr/local/nagiosxi/html/includes/components/ccm
SHELL=/sbin/nologin
SHELLOPTS=braceexpand:hashall:interactive-comments:posix
SHLVL=4
TERM=xterm
UID=48
USAGE='USAGE :check_exception_in_impala.sh urlString'
_=
-Mohan

Re: Not able to run the shell script from nagios web UI.

Posted: Thu Jul 21, 2016 10:25 am
by mcapra
Does the apache user and the nagios group have execute permissions on both that script and the jar file the script is trying to run?

From the Nagios XI server's CLI, can you su nagios and try running that script again?

Re: Not able to run the shell script from nagios web UI.

Posted: Fri Jul 22, 2016 3:14 am
by steelwedge
Thanks, I changed permissions of the jar to apache:nagios, it worked.

Re: Not able to run the shell script from nagios web UI.

Posted: Fri Jul 22, 2016 8:59 am
by mcapra
Excellent! Is it alright if we lock this thread and mark the issue as resolved?