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

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
steelwedge
Posts: 69
Joined: Fri Apr 24, 2015 4:58 am

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

Post 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
You do not have the required permissions to view the files attached to this post.
Last edited by mcapra on Thu Jul 21, 2016 9:39 am, edited 1 time in total.
Reason: please wrap long/technical outputs in [code] tags
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

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

Post 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?
Former Nagios employee
https://www.mcapra.com/
steelwedge
Posts: 69
Joined: Fri Apr 24, 2015 4:58 am

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

Post by steelwedge »

Thanks, I changed permissions of the jar to apache:nagios, it worked.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

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

Post by mcapra »

Excellent! Is it alright if we lock this thread and mark the issue as resolved?
Former Nagios employee
https://www.mcapra.com/
Locked