AS400 Nagios Plugin, v 0.19

This plugin allows the monitoring of an IBM AS400. The main goal was to right the plugin in such a way to prevent having to load extra client software on the AS400 or the monitoring server. In order to accomplish this, information is gathered through normal terminal operations.

Using the telnet service, a connection is established to the AS400 and OS400 commands are executed and the output parsed. Simple, yet effective, and with little over head.

Current monitoring variables include CPU Load, DB Load, Free Storage, Jobs, Active Jobs, Check if a job is running, Check if a subsystem is running and OUTQ and Message Queue monitoring.

I have been running this plugin 24x7 for over a year monitoring the mainframe at a local hospital where I work, and have had zero problems. In addition to monitoring the system status of the 400 including the CPU, DB load, storage, 8 jobs, 2 sub systems and the qsysopr messages, I monitor 29 printer queues.

Notes on the OUTQ variable:

Three different variables are used in determing the status of an OUTQ. First the OUTQ is checked that it has a connected writer, second that it is in RLS status, and third the number of files in the queue are compared with the specified threshold values. Any or all of these three variables may be disabled through command line switches. As an example I monitor printer queues which always have writers attached to them, (unless the printer is offline), and I also use it to monitor the fax queue, which dosn't have a writer. Also some users store reports in there outqs, so I disable the check on files.

Notes on the Message Queue variable:

The Message Queue monitoring presently only warns if there are any unanswered messages in the specified users queue. For example I use it to monitor qsysopr.

Notes on the Login variable:

I highly recommend the use of this variable in the creation of dependencies for all services you monitor. Especially if the user that you use with the plugin has an expiring password. This will prevent you from getting lots of alerts should the plugin be unable to login. (ie. QINTER is not running, your password expires, etc.)


As of version .16 debugging ability has been added to the plugin to help you and me solve problems. If you are having problems with the client either hanging or returning errors, manually run the check from the command line using the debug options, redirect the output to a file and email it to me. From that I can solve the problem. Do not worry. There is nothing generated that will violate you or your business's privacy, ex. IP addresses, passwords, etc. Below are some examples:

cd /usr/nagios/libexec
./check_as400 -D -H ashost -v CPU -w 80 -c 90 >debug.log


./check_as400 -D -H ashost -v SBS QINTER >debug.log

In the cases where it is hanging, execute the above command wait about 15 seconds for it to process through to where it hangs, and terminate it with a CTRL-C.

Then simply email me the debug.log file at


If you have suggestions or would like to submit bugs, visit the main page at sourceforge or email me at