On Aug 19, 2022, at 8:12 AM, Richard Schoen <richard@xxxxxxxxxxxxxxxxx> wrote:
I haven't followed this thread, but one option to check for an active service is simply to use the DB2 services SQL to do a NETSTAT port check via SQL:
Ex SQL to check for port 80:
SELECT * FROM QSYS2.NETSTAT_INFO WHERE CONNECTION_TYPE='IPV4' and LOCAL_PORT=80
This is packaged in a CL command called QSHPORTCHK as part of my QShell on i Tools (QSHONI)
And here's a sample where I'm using QSHPORTCHK to check for a Postgres Server and Gitbucket running on an IBMi system.
If port check fails, you could then run whatever commands you need. And if they are QSH/PASE commands, you can use the QSHEXEC or QSHBASH commands to fire them up from the green screen or job scheduler.
Also with this example that was given in a prior post:
Can instead be run like this:
When the command completes, simply read outfile QTEMP/STDOUTQSH to process the results from CL or RPG.
Hope this helps.
On 8/19/22 12:45 AM, Don Brown via MIDRANGE-L wrote:
I ran the QSH
and the result
Press ENTER to end terminal session.
How do I receive this result so I can interrogate and take an action
based on the result ?
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com
As an Amazon Associate we earn from qualifying purchases.
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.