Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

Check_as400

Current Version
1.5.2
Last Release Date
2019-08-27
Compatible With
  • Nagios 1.x
  • Nagios 2.x
  • Nagios 3.x
  • Nagios 4.x
  • Nagios XI
Owner
License
GPL
Hits
465876
Files:
FileDescription
check_as400_1.5.1.rarcheck_as400_1.5.1
check_as400_1.5.2.rarcheck_as400_1.5.2
Nagios CSP

Meet The New Nagios Core Services Platform

Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.

Monitoring Made Magically Better

  • Nagios Core on Overdrive
  • Powerful Monitoring Dashboards
  • Time-Saving Configuration Wizards
  • Open Source Powered Monitoring On Steroids
  • And So Much More!
Check_as400
Nagios plugin to monitor IBM System i (AS/400)



Check_as400 Version: 1.5.2 <2019/08/27>
* Added check for specific messages on log (CKMSG)(Thanks, j. howell)
* Added check for temp and perm address use (CKADDR) (Thanks, j. howell)

Check_as400 Version: 1.5.1 <2019/06/27>
* Fixed WRKSYSSTS check problem on V7R3

Check_as400 Version: 1.4.4 <2017/04/28>
* Fixed CPUT problem on OS V7R2.
* Added check job temporary storage used. (Thanks, BIANCHI Xavier)

Check_as400 Version: 1.4.3 <2016/05/18>
* Added ITALIAN language. (Thanks to Riccardo Morandotti) 2016/04/29
* Fixed CJS status.

Check_as400 Version: 1.4.2 <2015/10/22>
* Added SSL connection option.
* Fixed username display in Login ERROR message.
* Fixed Log in failure on 10 character username.

Check_as400 Version: 1.3.2 <2015/06/29>
* Modified Rocket iCluster checks to recognize Nagios user Not Authorized to iCluster

Check_as400 Version: 1.3.1 <2015/03/10>
* Modified check CJ for duplicate jobs, can specify job number for CRITICAL and WARNING values.

Check_as400 Version: 1.2.9 : <2015/02/11>
* Fixed check MSG for LANG FR/GE string index out of range error.
(Thanks to Frederic MOURAGUES)

Check_as400 Version: 1.2.8 : <2014/03/11>
* Added check for Number of file members.
(Thanks to Tim Vandegrift)

Check_as400 Version: 1.2.7.2 : <2013/08/29>
* Added check for work with problems.
* Added check for top CPU used job.
The total processing unit time used by the job.
* Fixed French language check DISK halt. <2013/10/31>
* Fixed iCluster parse String lost define <2014/02/13>

Check_as400 feature
* check CPU load.
* check top CPU used job.
* check ASP usage.
* check Pool DB/Non-DB Fault
* check number of active jobs in system.
* check to see if job is in the system.
* check Job Status.
* check Job temporary storage used.
* check number of jobs in JOBQ
* check DB utilization. (Not available after V6R1)
* check DISK Status.
* check if login completes.
* check for any unanswered messages on msg queue.
* check outq files, writer and status.
* check if the subsystem is running.
* check for Number of file members.
* check MIMIX Data Group Unprocessed Entry, transfer definition, RJ link state.
* check for Rocket iCluster. Node Status, Group Status, Switch Readines.

Last edited by Shao-Pin, Cheng Taipei, Taiwan
==========================================================

Install Note
-----------------
* Modify your $NAGIOS_PATH/.as400 with the correct user and password.
* Modify chech_as400 with the correct java path.
* Set NAGIOS user profile Display sign-on information *NO
- CHGUSRPRF USRPRF(NAGIOS) DSPSGNINF(*NO)
* For languages other than English , change system library list to ENGLISH.
*Use SSL connection
Must add CE to JAVA, EX:
keytool -import -trustcacerts -keystore /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.85.x86_64/jre/lib/security/cacerts -storepass changeit -noprompt -alias xxxx_ce -file /xx/xxx/XXXX.cer
Reviews (16)
After installing the plugin successfully, we are able to connect to AS400 system

CPU load
System -->48.98%
in Nagios output -->8.9 %

Can anyone help to identify why Nagios output is truncating the values and displays only 2nd decimal only.
byAURELIEN, July 15, 2020
hello

i have a problem with several as400.

If I execute the check in CLI I have correct results but I have to press CTRL+C to close it.

i see this answer but i can't get it to work.


* Nagios user may need to use IBM default sign-on display file
Or change nagiso user to other subsystem description to use system default display file(QSYS/QDSIGNON)


or
modify check_as400_lang.java
change this line

public String LOGIN_SCREEN="System . . . . .";

"System . . . . ." to fit your sigon menu

and recompile it.


for this option "change this line------public String LOGIN_SCREEN="System . . . . ."; "System . . . . ." to fit your sigon menu.
i don't understand the expected value
Owner's reply

You can check your Sign On screen. look like this.
Sign On
System . . . . . : ZZZZZZ
Subsystem . . . . : QINTER
Display . . . . . : QPADEVxxxxx

Change text value "System . . . . ." and recompile it

Hello,
i am not so the Administrator in AS400.
The following Points:
* Set NAGIOS user profile Display sign-on information *NO
- CHGUSRPRF USRPRF(NAGIOS) DSPSGNINF(*NO)
Initial program to call . . . . *NONE
Initial menu . . . . . . . . . . MAIN
Must i change this on the AS400?
Kind Regards
Hartmut
bygmrocha, October 11, 2016
Narcan, the plugin not cover all version of I/OS... I´ve to 2480 (PT/BRasil). Sometimes the WRKSYSSTS change a little bit, if a PTF is applied or not. In your case, there is a field ou there isn´t a field before Disk Usage (like db capability). And the plugin is getting something about ELAPSED TIME ... there is a count in .java that represent the number of ":" found... you have to increase one or two to get the information you need.

11/10/16 17:05:37
% CPU used . . . . . . . : 0,1 Auxiliary storage:
Elapsed time . . . . . . : 00:00:01 System ASP . . . . . . : 846,7 G
Jobs in system . . . . . : 368 % system ASP used . . : 64,8842
% perm addresses . . . . : 0,048 Total . . . . . . . . : 846,7 G
in CLI: ./check_as400 -H XX.XX.XX.XX -u XXXXX -p XXXX -v US -w 10 -c 5
give me this output:
Exception in thread "main" java.lang.NumberFormatException: For input string: "00:0"
at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source)
at sun.misc.FloatingDecimal.parseDouble(Unknown Source)
at java.lang.Double.parseDouble(Unknown Source)
at java.lang.Double.(Unknown Source)
at check_as400.parseWrkSysSts(check_as400.java:1039)
at check_as400.parse(check_as400.java:630)
at check_as400.main(check_as400.java:474)
Hi Denise,

I had same trouble when i check job, i look at the source of the plugin "check_as400.java" and i debug the source. I use french language for the plugin not try in English, but if you modify
the line 946 (function ParseChkJobsts)
String status=(buffer.substring(start+53,start+60)).trim(); by
String status=(buffer.substring(start+53,start+59)).trim();
Plugins Work
You have to recompile after modification
javac check_as400.java
I think same trouble apply to CJS.
Regards
byNooJ, July 9, 2015
1 of 1 people found this review helpful
Very good plugin, was able to make it work with an old os400, now we have updated our hardware/firmware and actually nagios give us "(Service check timed out after 90.01 seconds)"

I remember that on some older version I had to edit the token in check_as400.class

If I execute the check in CLI I have correct results but I have to press CTRL+C to close it.

This is what I have in debug mod :
[...]
CRITICAL - 888 active jobs in system | jobs=888;80.0;90.0;0;
Logging out...
sending F3...
waiting for token ===>...
token received.
requesting signoff...
waiting for token System . . . . ....

Have you a solution ?
Owner's reply

* Nagios user may need to use IBM default sign-on display file
Or change nagiso user to other subsystem description to use system default display file(QSYS/QDSIGNON)


or
modify check_as400_lang.java
change this line

public String LOGIN_SCREEN="System . . . . .";

"System . . . . ." to fit your sigon menu

and recompile it.

Hi,
I really need this plugin to check if a job is always active and his state TIMW, but i have the same probleme since 8 month and i cant resolve it:

# /usr/local/nagios/libexec/check_as400 -H X.X.X.X -v CJS EASYCOM FAX2
job(EASYCOM/FAX2) status(TIMW
# /usr/local/nagios/libexec/check_as400 -H X.X.X.X -v CJ FAX2
CRITICAL - job(FAX2) status([7;6H 1.)
# /usr/local/nagios/libexec/check_as400 -H X.X.X.X -v CJS EASYCOM FAX2 status TIMW
CRITICAL - job(EASYCOM/FAX2) status(TIMW
# /usr/local/nagios/libexec/check_as400 -H X.X.X.X -v CJS EASYCOM FAX2 status (TIMW
bash: syntax error near unexpected token `('
# /usr/local/nagios/libexec/check_as400 -H X.X.X.X -v CJS EASYCOM FAX2 status "(TIMW"
CRITICAL - job(EASYCOM/FAX2) status(TIMA

As you can see, CJ return a strange code and CJS return the state with one parenthesis...

Note: As400 is in french language so I have recompile the plugin with the correct language

Any help would be very appreciate! Thanks
byclementc, November 17, 2014
This is a very good plugin, it's work very well.
I have a question, can I put a screen number, because on one of our AS400 we stop QINTER and for connecting, we have to force screen number for security reason.
You have done an excellent job that lets Nagios (and its flavors) to get deep into iSeries monitoring. It could be easy extended.
One issue that I found is in parseDspMsg when there are a few pages of "need-reply" messages and a new "do not need reply" messages page appears. In this case, where (e.g. k = 334 i=460) we get: Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -126 at java.lang.String.substring(Unknown Source).

This happens in line "String str3 = paramString.substring(i, k);" where the begin is 460 and end is 334 (!!!) that is not possible.

Thank you for your excellent work!
bykgauler, February 4, 2014
I use it checking about 30 functions of the iSeries. It just works like expected.
Klaus Gauler
Does what it said.
All checks i had setup work perfectly for over 6 months now on a V5R2M0 English system.
I would love to see a more detail online help, but anyway the dev had always and quickly reply my emails.
Good job !
This worked great for our Version 5 OS, but there we a couple of issues for 7.1.

Below are the changes to make the wrksyssts portions to work with 7.1
// else if(ARGS.checkVariable==DB){
// start=findToken(buffer,":",5)+1;
// double db=(new Double(checkDouble((buffer.substring(start,start+11)).trim()))).doubleValue();
//
// returnStatus=getStatus(db);
//
// System.out.println("DB Load ("+nf.format(db)+"%) | DBload="+nf.format(db)+";80;90;0; ");
// }
else if(ARGS.checkVariable==US){
double percentFree,total,percentUsed;

start=findToken(buffer,":",10)+1;
percentUsed=(new Double(checkDouble(buffer.substring(start,start+11)))).doubleValue();
start=findToken(buffer,":",10)+1;
percentFree=100.0-(new Double(checkDouble(buffer.substring(start,start+11)))).doubleValue();
// start=findToken(buffer,":",12)+1;
start=findToken(buffer,":",8)+1;
String tot=((buffer.substring(start,start+11))).trim();
total=(new Double(checkDouble(tot.substring(0,tot.length()-1)))).doubleValue();

returnStatus=getStatus(percentFree);

System.out.println(nf.format(total*(percentFree/100))+" "+tot.substring(tot.length()-1)+" ("+nf.format(percentFree)+"%) free of "+((buffer.substring(start,start+11))).trim()+" | ASP="+nf.format(percentUsed)+"%;87;92;0; ");
}
else if(ARGS.checkVariable==JOBS){
start=findToken(buffer,":",9)+1;
int jobs=(new Integer((buffer.substring(start,start+11)).trim())).intValue();

returnStatus=getStatus(jobs);

System.out.println(jobs+" jobs in system | jobs="+jobs+";;;0; ");
byhomer78, March 10, 2011
Hi,

i have the same problems as hlustik.
So i wanted to recompile the plugin but got the following problems:
javac check_as400_lang.java
/usr/lib/gcc/i586-suse-linux/4.5/../../../crt1.o: In function `_start':
/usr/src/packages/BUILD/glibc-2.11.2/csu/../sysdeps/i386/elf/start.S:115: undefined reference to `main'
collect2: ld returned 1 exit status


javac check_as400.java
check_as400.java:562: warning: The local variable newStart is never read
int index=0,start=-1,newStart=0;
^^^^^^^^
1 problem (1 warning)
/usr/lib/gcc/i586-suse-linux/4.5/../../../crt1.o: In function `_start':
/usr/src/packages/BUILD/glibc-2.11.2/csu/../sysdeps/i386/elf/start.S:115: undefined reference to `main'
/tmp/ccP8HXmU.o: In function `void check_as400::main(JArray*)':
ccJjSfTx.jar:(.text+0x28e6): undefined reference to `check_as400_cmd_vars::class$'
ccJjSfTx.jar:(.text+0x28f5): undefined reference to `check_as400_cmd_vars::check_as400_cmd_vars()'
ccJjSfTx.jar:(.text+0x2903): undefined reference to `check_as400_lang::class$'
ccJjSfTx.jar:(.text+0x2912): undefined reference to `check_as400_lang::check_as400_lang()'
/tmp/ccP8HXmU.o:(.data+0x104): undefined reference to `check_as400_cmd_vars::class$'
/tmp/ccP8HXmU.o:(.data+0x114): undefined reference to `check_as400_lang::class$'
collect2: ld returned 1 exit status
check_as400.java:562: warning: The local variable newStart is never read
int index=0,start=-1,newStart=0;
^^^^^^^^
1 problem (1 warning)


Did i forgot to install something?
thanks,
homer78
byhlustik, January 4, 2011
1 of 1 people found this review helpful
i just get two error messages for check_as400_jobs
and check_as400_msg
1) check_as400_jobs ( the number of jobs in the system is displayed inverted )

Exception in thread "main" java.lang.NumberFormatException: For input string: "[7m
[0"at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:449)
at java.lang.Integer.(Integer.java:660)
at check_as400.parseWrkSysSts(check_as400.java:641)
at check_as400.parse(check_as400.java:398)
at check_as400.main(check_as400.java:325)

2) check_as400_msg qsysopr

Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -102
at java.lang.String.substring(String.java:1937)
at check_as400.parseDspMsg(check_as400.java:470)
at check_as400.parse(check_as400.java:402)
at check_as400.main(check_as400.java:325)

as i have not found any mail adress i post this here.
Owner's reply

Definitions AS/400 use ENGLISH language may solve your problem.

bysebnad, September 15, 2010
1 of 1 people found this review helpful
with an other person. We change this to see the message on dspsmg

public static int parseDspMsg(String paramString) {
if (paramString.indexOf(LANG.NO_MESSAGES_AVAILABLE) != -1) {
System.out.println("OK - No messages");
return 0;
}

int i = paramString.indexOf("cessitant une r", 0);
int j = paramString.indexOf("cessitant pas de r", 0);
i += 72;
j -= 72;
String str1 = paramString.substring(i, j);
try {
String str2 = new String(str1.getBytes("ISO-8859-15"), "UTF-8");
System.out.println(str2);
}
catch (UnsupportedEncodingException localUnsupportedEncodingException) {
System.err.println(localUnsupportedEncodingException);
}

return 1;
}