We help IT Professionals succeed at work.

Scripts to monitor IBM i

Matthew Roessner
One of our developers has asked that we run a script that they wrote every 3-5 minutes on our iSeries.  The script is set up to see if a particular port is open - and if it isn't, then to start their application.

The script is a .sh (monitor.sh) file located in the IFS.

Is there any easy way to do this?
Watch Question

VP Technology / Senior Consultant
Assuming this is a QShell script, it is fairly expensive in terms of resources to submit a new job every 3-5 minutes, and even more so with a job that starts a QShell session.  So submitting a new job each time may not be desirable.
Perhaps you can submit the job once, and set it up to loop with a QShell "sleep" at the end of the script.  "sleep" is the QShell equivalent of DLYJOB.

To execute the script from the command line, from CL, or from the jobs scheduler:

QSH CMD(\path\to\script\monitor.sh)

- Gary