200 code website

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Bogdan_B
Posts: 34
Joined: Fri Aug 03, 2012 1:56 am

200 code website

Post 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
User avatar
nscott
Posts: 1040
Joined: Wed May 11, 2011 8:54 am

Re: 200 code website

Post 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.
Nicholas Scott
Former Nagios employee
Bogdan_B
Posts: 34
Joined: Fri Aug 03, 2012 1:56 am

Re: 200 code website

Post 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)
Bogdan_B
Posts: 34
Joined: Fri Aug 03, 2012 1:56 am

Re: 200 code website

Post 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 ?
Last edited by Bogdan_B on Mon Aug 06, 2012 9:44 am, edited 1 time in total.
User avatar
nscott
Posts: 1040
Joined: Wed May 11, 2011 8:54 am

Re: 200 code website

Post 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/
Nicholas Scott
Former Nagios employee
Bogdan_B
Posts: 34
Joined: Fri Aug 03, 2012 1:56 am

Re: 200 code website

Post 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
yancy
Posts: 523
Joined: Thu Oct 06, 2011 10:12 am

Re: 200 code website

Post by yancy »

Bogdan_B,

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


Regards,

-Yancy
User avatar
nscott
Posts: 1040
Joined: Wed May 11, 2011 8:54 am

Re: 200 code website

Post 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>
Nicholas Scott
Former Nagios employee
Bogdan_B
Posts: 34
Joined: Fri Aug 03, 2012 1:56 am

Re: 200 code website

Post 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.
yancy
Posts: 523
Joined: Thu Oct 06, 2011 10:12 am

Re: 200 code website

Post by yancy »

Bogdan_B,

This will match the file permissions to the one that works

Code: Select all

 chmod 755 <scriptname> 

-Yancy
Locked