× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Well if he wants it in an RPG program then simply use HTTPAPI - really easy to use.


Jon P.

On Aug 19, 2022, at 11:21 AM, Richard Schoen <richard@xxxxxxxxxxxxxxxxx> wrote:

Yes http call definitely more accurately.

A little curl via QSHEXEC or QSHBASH will solve that for you.

Same result is outfile data to process from QTEMP/STDOUTQSH.

I don't usually use or recommend the DB2 http stuff.

Regards,
Richard Schoen
Web: http://www.richardschoen.net
Email: richard@xxxxxxxxxxxxxxxxx

----------------------------------------------------------------------

message: 1
date: Fri, 19 Aug 2022 10:36:46 -0400
from: Jon Paris <jon.paris@xxxxxxxxxxxxxx>
subject: Re: Checking if a web server service is running from green
screen

Wouldn't it be more reliable to actually run an HTTP request against the port? All NetStat is going to tell you is that something is listening. Or even Telnet.


Jon P.

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) https://github.com/richardschoen/QshOni

And here's a sample where I'm using QSHPORTCHK to check for a Postgres Server and Gitbucket running on an IBMi system.
https://github.com/richardschoen/QshOni/blob/master/samples/gitportsc.
clp

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:
QSH CMD('/QIBM/ProdData/OS/WebServices/bin/listWebServicesServers.sh')

Can instead be run like this:
QSHONI/QSHEXEC CMDLINE('/QIBM/ProdData/OS/WebServices/bin/listWebServicesServers.sh')

When the command completes, simply read outfile QTEMP/STDOUTQSH to process the results from CL or RPG.

Hope this helps.

Regards,
Richard Schoen
Web: http://www.richardschoen.net
Email: richard@xxxxxxxxxxxxxxxxx
--
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,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

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.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.