Page 1 of 1

Problems with "check_as400"

Posted: Tue Jan 22, 2013 11:18 am
by rbaholding
Hi!
I want to control my server AS 400 (it's all in Spanish) and followed the following steps:

tar-xzvf as400NagiosPlugin-018.tgz
cd as400NagiosPlugin
mkdir /usr/local/nagios/libexec/check_as400
cp *. class /usr/local/nagios/libexec/check_as400/
check_as400 cp /usr/local/nagios/libexec/check_as400/

Then create a hidden file that contains the user name and password for the AS/400 user.

cd /usr/local/nagios/libexec/check_as400/
vim .as400
USER=as400_account
PASS=as400_password

chown -R nagios.nagios /usr/local/nagios/libexec/check_as400/
chmod 700 /usr/local/nagios/libexec/check_as400/.as400

I edit the file "check_as400" and write the path Nagios, Java and plugins:

vim /usr/local/nagios/libexec/check_as400/check_as400

USER=`cat /usr/local/nagios/libexec/check_as400/.as400 | grep -e USER | cut -d = -f 2`
PASS=`cat /usr/local/nagios/libexec/check_as400.as400 | grep -e PASS | cut -d = -f 2`
/usr/bin/java -cp /usr/local/nagios/libexec/check_as400 check_as400 -u $USER -p $PASS $*

I do a test from SSH: ./check_as400 -H myserver -u xxxxx -p xxxxx -v LOGIN. The result is: "OK - Login completed successfully" but does logoff. Why?
1.jpg
If I do a test from the web interface, the output comes out empty and if I make an application changes, this error appears:
2.jpg
3.JPG
I've seen at the following URL: "http://exchange.nagios.org/directory/Pl ... 00/details" to do the following steps:
Login AS/400 Nagios check ID
CHGUSRPRF USRPRF(NAGIOS) DSPSGNINF(*NO) ---> Result is correct.
CHGSYSLIBL LIB(QSYS2984) OPTION(*ADD) ---> Result is incorrect. QSYS2984 Library not found.

I do not know follow....

Thanks in advance.
Regards.

Re: Problems with "check_as400"

Posted: Tue Jan 22, 2013 11:36 am
by scottwilkerson
run

Code: Select all

chmod +x /usr/local/nagios/libexec/check_as400
This should get rid of the 126 error you are seeing for the configured service

The "test command" button may have some difficulty with certain commands as it tries to escape special chars but this doesn't always work propperly

Re: Problems with "check_as400"

Posted: Tue Jan 29, 2013 9:52 am
by rbaholding
Change the permissions that you told me, but now I get the following message: "(Service Check Timed Out)".

I modified the file nagios.cfg the following command: service_check_timeout = 600. But still I kept failing.

We can not have my AS400 server is all in Spanish?

Re: Problems with "check_as400"

Posted: Tue Jan 29, 2013 12:12 pm
by scottwilkerson
If your username or password have special chars in them you may need to put quotes around them in XI

Re: Problems with "check_as400"

Posted: Tue Jan 29, 2013 12:21 pm
by rbaholding
My username and password is case-sensitive letters and numbers

Re: Problems with "check_as400"

Posted: Tue Jan 29, 2013 12:43 pm
by abrist
Could you try running the check from the command line again, this time as the user "nagios"?

Re: Problems with "check_as400"

Posted: Tue Feb 05, 2013 7:17 am
by rbaholding
Sorry for the delay in answering ....

I tried to run from a command line. The answer is: "OK - Login completed successfully" but I get the prompt to continue writing.
Captura.JPG

Re: Problems with "check_as400"

Posted: Tue Feb 05, 2013 11:02 am
by lmiltchev
I am not familiar with this plugin, nor I can test it in our environment, but just a "wild guess"... Did you follow all of the instructions listed under the "Install Note":
* For languages other than English , change system library list to ENGLISH.
http://exchange.nagios.org/directory/Pl ... 00/details

Re: Problems with "check_as400"

Posted: Thu Feb 07, 2013 2:40 am
by rbaholding
In the end I ended up running ..... I found a check_as400_lang.java Spanish, v0.20 compiled and it worked correctly.