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



How do I know if a command completed successfully - I thought if the $ was
not returned then the command was still running or failed ?

from strqsh I ran the following;

/QOpenSys/pkgs/bin/curl -vS -XPOST <server_url>l:<port_number>/gelf -d

{ "short_message": "This is a short message",
"full_message":"This is th efull message ",
"host":"Hostname", "version":"Version", "timestamp":
"2021-08-03T00:00:20.716927",
"level": "01" }
Note: Unnecessary use of -X or --request, POST is already inferred.

* Trying 192.168.126.69:5514...
* Connected to <server_url> (192.168.126.69) port <port_number> (#0)

> POST /gelf HTTP/1.1
> Host: <server_url>:<port_number>
> User-Agent: curl/7.70.0
> Accept: */*
> Content-Length: 1
> Content-Type: application/x-www-form-urlencoded
>
* upload completely sent off: 1 out of 1 bytes


What is this telling me ?

Is the last line indicating on 1 byte was accepted ?

Why does the $ prompt not get issued/sent ?

Would I get more information from the stdout file ? And where would I find
the file ?

Thank you for any assistance

Don





From: "Richard Schoen" <richard@xxxxxxxxxxxxxxxxx>
To: "midrange-l@xxxxxxxxxxxxxxxxxx" <midrange-l@xxxxxxxxxxxxxxxxxx>
Date: 02/09/2021 02:29 PM
Subject: RE: curl works from strqsh but not from QSH
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxxxxxxxx>



Probably threading issues.

Most likely this one is the issue:
ADDENVVAR ENVVAR(QIBM_MULTI_THREADED) VALUE(Y) REPLACE(*YES)

Or try to install and use the QSHEXEC command to run your curl stuff or
analyze the QSHEXECC program and check the environment variables.

QShell on i
https://github.com/richardschoen/qshoni

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

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

message: 5
date: Thu, 2 Sep 2021 14:21:57 +1000
from: Don Brown via MIDRANGE-L <midrange-l@xxxxxxxxxxxxxxxxxx>
subject: curl works from strqsh but not from QSH

If I start qshell (STRQSH) I can run a command like;

/QOpenSys/pkgs/bin/curl -k -XPOST https://<address>:<port>gelf -d
''{"short_message": "|QSYS-QHST|CPF1124|Low|","full_message
<more_information_in_here> }'' ')

This runs successfully.

But if I try and run that from an RPG program like;

cmd = 'QSH CMD(''/QOpenSys/pkgs/bin/curl -k '
+ '-XPOST https:<address>:<port>/gelf -d
+ '''''{"short_message": "' + %trim(shortMessageZ1)
+ '"full_message":"' + %trim(fullMessageZ1) + '", '
+ '"host":"' + %trim(hostZ1) + '", '
+ '"version":"' + versionZ1 + '", '
+ '"timestamp":' + %char(msgTimeStampZ1)
+ %subst(msgTimeStampA: 20: 4) + ', '
+ '"level":' + %trim(levelZ1) + ' }'''''')';

cmdLen = %len(%trim(cmd));
callp(e) QCmdExc(Cmd:CmdLen);

I get error qsh: 001-0014 Command /QOpenSys/pkgs/bin/curl not found.

What am I missing ?

Thank you

Don

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.