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



Hello Don,

Am 08.09.2021 um 09:55 schrieb Don Brown via MIDRANGE-L <midrange-l@xxxxxxxxxxxxxxxxxx>:

This works but I have found if there are many messages to be written I can
get an error
curl: (7) Failed to connect ... connection refused

This message appears in the joblog

Yes, this is clearly the other side not accepting (another) connection.

My call looks like this;

callp(e) QCmdExc(Cmd:CmdLen);
if %error();

I do get an error but how do I retrieve the actual error that is being sent to the job log (or the qsh session if run interactively) ?

In Unix, shell commands give return values. Sometimes, they're meaningful, sometimes, it's just "if not 0, then error".

After running a shell command, the return value can be used in multiple ways. It can be obtained from the environment variable $?:

true; echo $?
=> 0

false; echo $?
=> 1

(True and false are shell commands just returning 0 or 1.)

So, in theory you can do a

until curl …; sleep 1; done

This makes curl run again and again through a loop until it returns 0. Tried the basic syntax out with 7.2; works.

I have no experience with running UNIX commands in qsh and how/if the return value is passed back to the caller. Maybe others can chime in here?

I think the server is just having a hard time keeping up so if I get this error I was going to retry sending the post or perhaps put a short sleep to handle this issue.

I wonder if hammering each syslog message to Greylog in a separate http request is a good idea at all. :-)

Appreciate any suggestions

I've not yet played with Greylog, so I can't give you an opinion here. Sorry.

:wq! PoC


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.