Page 1 of 2

200 code website

Posted: Fri Aug 03, 2012 3:52 am
by Bogdan_B
Hi,

I try to monitor my website. My expectation is 200 code. All is fine if I run below command but when I try to customize in Nagios Core Config Manager I received Return code of 126 is out of bounds - plugin may not be executable message. Could you please help me? Thank you !

Code: Select all

[root@NagiosXi libexec]# ./SCRIPT.pl -u https://website.com -p xxx.xxx.xxx.xxx -l yy -e 200
OK - Status: 200 OK
Command line is :

Code: Select all

$USER1$/SCRIPT.pl -U $HOSTADDRESS$ -P $ARG1$ -L $ARG2$ -E $ARG3$
ARG1=xxx.xxx.xxx.xxx
ARG2=yy
ARG3=200

Re: 200 code website

Posted: Fri Aug 03, 2012 9:51 am
by nscott
In the command definition you are using -E, while in the command line you're using -e, try rectifying that problem and see if that fixes it.

Re: 200 code website

Posted: Mon Aug 06, 2012 3:01 am
by Bogdan_B
Hi I rectified but the error is still there. :evil:

Code: Select all

# cd /usr/local/nagios/libexec

Code: Select all

[root@NagiosXi libexec]# ./script.pl -u HOST -p xxx.xxx.xxx.xxx -l yy -e 200
OK - Status: 200 OK
Command line:

Code: Select all

 $USER1$/script.pl -u $HOSTADDRESS$ -p $ARG1$ -l $ARG2$ -e $ARG3$
Service Management of HOST
$ARG1$ = xxx.xxx.xxx.xxx
$ARG2$ = yy
$ARG3$ = 200
Additional templates

Template name = xiwizard_website_http_service ( I already tried generic-service template )

The error message is : (Return code of 126 is out of bounds - plugin may not be executable)

Re: 200 code website

Posted: Mon Aug 06, 2012 7:56 am
by Bogdan_B
I rectified it but still not work. :evil:

Let's recap:

Code: Select all

cd /usr/local/nagios/libexec

Code: Select all

[root@NagiosXi libexec]# ./script.pl -u https://intranet -p xxx.xxx.xxx.xxx -l yy -e 200
OK - Status: 200 OK
Command line:
$USER1$/script.pl -u $HOSTADDRESS$ -p $ARG1$ -l $ARG2$ -e $ARG3$
where:
$ARG1$=xxx.xxx.xxx.xxx
$ARG2$=yy
$ARG3$=200
Return code of 126 is out of bounds - plugin may not be executable


P.S. I would like to have rights for Customers section because I bought Nagios Xi, what should I do ?

Re: 200 code website

Posted: Mon Aug 06, 2012 9:28 am
by nscott
IN the command definition you're referring to it as czwiki.pl and in the command line example its script.pl, not sure if you're editing one, but that would cause it.

Also, could you post the permissions on the plugin directory?

ll /usr/local/nagios/libexec/

Re: 200 code website

Posted: Mon Aug 06, 2012 9:47 am
by Bogdan_B
Do you want the permissions only for script.pl right?

Code: Select all

-rwsrwsr--  1 root   root      3529 Jul 10 15:20  script.pl 
I forgot to change the name only in the last post, the name of script is the same in both.

Cheers

Re: 200 code website

Posted: Mon Aug 06, 2012 10:33 am
by yancy
Bogdan_B,

Are the permissions of this file different from other files in that directory?


Regards,

-Yancy

Re: 200 code website

Posted: Mon Aug 06, 2012 10:48 am
by nscott
If its going to be owned by root, you'll definitely have to make it executeable for other. I also see you have the sticky bit enabled, this should do the trick:

Code: Select all

cd /usr/local/nagios/libexec
chmod 7555 <scriptname>

Re: 200 code website

Posted: Tue Aug 07, 2012 5:19 am
by Bogdan_B
@nscott

Code: Select all

-r-sr-sr-t 1 root root 3529 Jul 10 15:20 /usr/local/nagios/libexec/script.pl
Now the Status information is (null). :?:

@ yancy
Yes, there are different rights for different files. You can see below one of them who works :

Code: Select all

-rwxr-xr-x  1 apache apache    4361 May 15 12:43 ckformlogin.pl
But I already tried those rights for script.pl and no success.

Re: 200 code website

Posted: Tue Aug 07, 2012 9:26 am
by yancy
Bogdan_B,

This will match the file permissions to the one that works

Code: Select all

 chmod 755 <scriptname> 

-Yancy