Check_as400 Popular

Bookmark and Share

Rating
8 votes
Favoured:
1
Current Version
1.2.0
Last Release Date
2013-05-13
Compatible With
  • Nagios 1.x
  • Nagios 2.x
  • Nagios 3.x
  • Nagios XI
Owner
E-mail
License
GPL
Hits
228101
Files:
FileDescription
check_as400_1.2.0_SP1.zipcheck_as400_1.2.0
Check_as400
Nagios plugin to monitor IBM System i (AS/400)
Check_as400 Version: 1.2.0 : <2013/05/13>
* check number of jobs in JOBQ
* check Job Status.
* check MIMIX transfer definition and RJ link state.

Check_as400 Version: 1.0.1 :
* check CPU load.
* 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.
* 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 MIMIX Data Group Unprocessed Entry Count.

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

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.
Reviews (4)
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;
}
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
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.