× 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.

Thanks Scott

I will try that.

And my money is on pasting and compiling the "off the top of my head" code
and it working!!



From: "Scott Klement" <midrange-l@xxxxxxxxxxxxxxxx>
To: "Midrange Systems Technical Discussion"
Date: 19/08/2022 04:13 PM
Subject: Re: Checking if a web server service is running from green
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxxxxxxxx>

In my opinion, the best way to do it from RPG would be to use a tool

This is off the top of my head and untested, but i'd do something like
this with UNIXCMD:

dcl-f UNIX disk(132) handler('UNIXCMDOA': cmd) usropn;

dcl-s cmd char(5000);
dcl-ds record len(132) end-ds;
dcl-s inst char(10) dim(2);

dcl-pr QCMDEXC extpgm('QSYS/QCMDEXC');
cmd char(5000) const;
length packed(15: 5) const;
igc char(3) const options(*nopass);

cmd = '/QIBM/ProdData/OS/WebServices/bin/listWebServicesServers.sh';
open UNIX;

read UNIX record;
dow not %eof(UNIX);

if %scan('running': record) = 0;
inst = %split(record:' ');
cmd = 'STRTCPSVR *HTTP HTTPSVR(' + %trim(inst(1)) + ')';
QCMDEXC(cmd: %len(cmd));

read UNIX record;

close UNIX;
*inlr = *on;

If you can't use a tool like this, then you have to write the output
from QSH to a temporary file, and read the file. Or learn how to use
the pipe and spawn APIs.


On 8/19/22 1:01 AM, Don Brown wrote:
Preferably ILE RPG

But if there is a reference for other options then I am always keen to
learn more.

I just need a utility that will check if a web service is started and if

not start it that can be automated.



From: "Scott Klement" <midrange-l@xxxxxxxxxxxxxxxx>
To: "Midrange Systems Technical Discussion"
Cc: "Don Brown" <DBrown@xxxxxxxxxx>
Date: 19/08/2022 03:56 PM
Subject: Re: Checking if a web server service is running from green

In what language? QShell?

On 8/19/22 12:45 AM, Don Brown via MIDRANGE-L wrote:
Thanks Bryan,

I ran the QSH

and the result

WSERVICE01 (Running)

Press ENTER to end terminal session.

How do I receive this result so I can interrogate and take an action
on the result ?



This email has been scanned for computer viruses. Although MSD has taken

reasonable precautions to ensure no viruses are present in this email,
MSD cannot accept responsibility for any loss or damage arising from the

use of this email or attachments.^_sb

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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

This mailing list archive is Copyright 1997-2023 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.