Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Jan-Erik Lärka

Pages: [1] 2 3 ... 21
1
Programming / Re: [Classic REXX] Network Map
« on: April 01, 2025, 09:18:32 pm »
Hi Jan-Erik
Sorry having added a lof of codes  ::)

Ohh, yes, I soooOOooo crossed (NOT!) that you've improved the script further than one could hope for.

I''m actually very pleased that you've come up with all of these enhancements, but don't tell anyone I wrote that.  ;)

2
Programming / Re: [Classic REXX] Network Map
« on: March 28, 2025, 08:52:27 pm »
Great update of the script Remy!  8)

It now tell me that the vacuum cleaner has gone offline for the night, but it managed to pull out the cable of the laptop today and ensured it went offline as well.

I comment the 2 initial SET line into de macaddr.cmd and use those from config.sys
uncomment bof lines if you would like set these two vars without config.sys update
e.g.  remove /* and */ of both lines and set value to 1 or 0
/* 'SET WOL=1' */   
/* 'SET NET=1' */

Just type
SET WOL=1
SET NET=1
on the command line before you run the script and those will be added to each object it create, thus not require any of them in config.sys

or create a program object "Refresh" pointing to the script, without any parameter, but with
WOL=1
NET=1
in the Environment tab (See each created network object for examples).


How about merging/reuse code for the various calls that resemble each other, and control them with parameters?
Perhaps explore the use of parsing templates:
PARSE VALUE ... WITH pre (fixed_variable1) mid (fixed_variable2) post

The idea was initially to build a network map of the devices found on the home LAN with info about them.
What uses can we explore here?
Shares would be one thing, but ... are there something else that one want and can be created?!

3
Programming / Re: [Classic REXX] Network Map
« on: March 27, 2025, 09:17:15 pm »
Feel free to modify the code and post it here, both for testing purposes and to improve it.

4
Programming / Re: [Classic REXX] Network Map
« on: March 27, 2025, 06:13:36 am »
SAY '>'STG'<'
is there to say it sent that as a Wake on Lan call to that machine.
But since the mac address isn't there it can't create a proper call to wake it up.

5
Programming / Re: [Classic REXX] Network Map
« on: March 26, 2025, 07:04:44 pm »
I would say that that explain the problems.
*** Can't find server name for address 192.168.0.1: Non-existent host/domain
then no script can help until it's configured to reply with something useful.

Hi!

What is the name returned from a nslookup 192.168.0.106 ?
Is it the one under nostname from config.sys ?

Today, my machines address is 192.168.0.104,
Code: [Select]
H:\tmp>nslookup 192.168.0.104
*** Can't find server name for address 192.168.0.1: Non-existent host/domain
*** Default servers are not available

config.sys has,
Code: [Select]
SET HOSTNAME=ARCAOS-44454C4

6
Programming / Re: [Classic REXX] Network Map
« on: March 26, 2025, 07:01:00 pm »
Seen.

I have a specific ARCAOS host_name under config.sys
Into my box and because my PC can be booted OS/2 or Windows using same interface, I have set a name to the corresponding @ip / macaddr
Using nslookup on my PC @ip I could see that my computer_name set into the box differs from the config.sys and after updating config.sys, it works

With WOL=0 and NET=0, it display all local equipments.
When I set WOL=1, I have all equipment but also many
(icoplte    (icoplte    (icoplte    (icoplte    (icoplte    (icoplte ....

Remy, I've only been able to test with English version, is it possible that the parsing has to be adjusted somewhat?

With NET=1, I have the folder created as well all found equipment but none have an icon !
Where are icon found ?
That also mean that I need help to create the artwork for it.  ;)
But see the icons I use here.
I would suggest a change into the rexx which could prevent this kind of no returned result.
Check the interface used and look for its @ip followed by a nslookup on the @ip which will return the hostname and then run into the process like if the
the host_name was found into os2env variables....
That's something to fall back on, as several of you seem to not be able to get "host" to return proper info

7
Programming / Re: [Classic REXX] Network Map
« on: March 25, 2025, 06:33:46 am »
It is supposed to find all machines on the network, and here it does!

My hosts file on this newlt installed ArcaOS 5.0.7, read
127.0.0.1                localhost
and nothing else.
My router thus provide my machines with the information and ip-number through dhcp as the vacuum cleaner was introduced just days ago... and when the script run again it update the info (and icons, if SET NET=1 is active) and show that 2 devices has gone offline over the night.

So the question remain... why host command behave the way it does.

"DHCP Monitor" of course list the ip-address on LAN0 for you?
( Desktop\Computer\System Setup\Network\TCP/IP\DHCP Monitor )

8
Programming / Re: [Classic REXX] Network Map
« on: March 24, 2025, 10:45:00 pm »
If the host command in TCP/IP say it is unknown, then one can't do much about it in the script.
 
Anyone know why host can't retrieve it?
Is it some security setting in the router, a missing setting or ...?

9
Programming / Re: [Classic REXX] Network Map
« on: March 24, 2025, 07:16:52 pm »
Neil: Interesting, and you get anything else if you run the OS/2 commands (HOST, NETSTAT, PING and ARP) by hand?
Or should the script be adjusted to use some other parameter with the above commands?

The script determine the IP-number from the machine that run the script.
Dave: Can it be something like 192.168.0.101 for your machine?

The script PARSE away the last part and then PING 192.168.0.1 to 192.168.0.255 and follow that by listing each with ARP
Could you please add
Code: [Select]
call trace '?i'before the first line that begin with '@HOST and step through the code and tell us?

Some of the PARSE lines may very well need tweaking depending on wrong assumptions made

10
Programming / Re: [Classic REXX] Network Map
« on: March 23, 2025, 08:46:43 am »
I've added a line to the script to open the folder as it refresh the devices.

11
Hello,

Here's a script I've just completed to download and install information about REXX.
You have 10 titles to choose from and enjoy.

Beware that the script has not been tested that much and may cause problems, especially when sites such as hobbesarchive.com complain or is down.
I leave testing and extending the script to you, to enhance it further.


 REXX tutorials under ArcaOS out-of-the-box
 ==========================================
 1. REXX for the absolute beginner: Installed
 2. Rexx Reference Summary Handbook: Installed
 3. REXX Tips & Tricks v3.60: Installed
 4. Learning REXX Programming in 56,479 Steps: Installed
 5. OS/2 REXX. From Bark to Byte: Installed
 6. REXX Programmers Reference 2nd Edition: Installed
 7. REXX Tutorial: Installed
 8. A Practical Approach to Programming: Installed
 9. OS/2 2.1 Rexx Handbook (Warning! 321MB): Installed
10. Extending the Workplace Shell with Object Rexx: Installed

 Install <A>ll or 1, 2 ... ( ? for additional Info, 0 to Exit ):


Regards,
//Jan-Erik

12
Programming / [Classic REXX] Network Map
« on: March 16, 2025, 04:16:38 pm »
I'm trying to write a REXX script to list the devices available on my home LAN.

It use commands available in the OS to get the host name, ip-number and mac address.

Here I can see on the names that it has found computers, mobile phones, vacuum cleaner, routers etc. on the same subnet and indicate if they're offline or not.
I'd also like to, if possible, find out what kind of device the script has listed and set icons accordingly, and not just online/offline. How?!

That also mean that I need help to create the artwork for it.  ;)

The script in default mode without parameters determine the ip-address of the computer, ping and check for others 1 to 255.
With environment variable SET WOL=1 it also send a "wake on lan call" to each machine.
With environment variable SET NET=1 it also create a folder Network Map* in the folder Network, with a sub folder for workgroup* or domain* and individual objects (online*/offline*) for each device. If one click on a device it will refresh (run the script and update the object itself).

13
First of all we need a function that can check if an executable can run or if the library/file exist or not.

Since we don't have a list of the files nor their types yet, our function can only be prepared to:
  • Support obvious file types such as .exe, .hlp/.inf, .pdf and .cmd
  • Take one parameter by default, the file to check and return 0 if all is well or another number depending on the problem.
  • Be extendable and allow for more files types and at least one more parameter or stem/array later.

Try to write a function and post it here, that can test if for example wget.exe (without path*) is present or not on the system.
Hints:
  • rc = 1041 not available
  • rc <> 0 missing support libraries
  • other problem and rc = 0 ok

*The function should try determine the path if needed, but not provided, with for example SysSearchPath(...).

14
It is the start to look at that is a good starting point, with a need for more, so let's keep this thread alive.

So what do we need/want?

Should we aim to support a specific version of OS/2 and newer? ¹)
A list of handbooks related to REXX. The list that Dariusz Piatkowski showed should be a good starting point, where can the files be downloaded from?
There should also be a dedicated section about "Object REXX" ²) and "ooRexx" ²).
PDF and/or INF/HLP format?

What would you like to see/need? Dan and Lewis
Is it a broader discussion about what REXX can do and how, a list of functions one can copy/paste into own projects, or...?

____
¹) Various libraries has been introduced and removed in versions of eComStation and ArcaOS. The proper way would be to assume that there is only Classic REXX in Warp 4 installed with the limitations and bugs found there and provide functions that check and test the system and then work from there. It may require rather large functions to be complete, but may be what we should aim for?
Example 1: To get the boot drive of the system currently in use one can call the function SysBootDrive, but it is only available with later versions of RexxUtil, so to write scripts that work with any version of the OS, one has to expand it somewhat (see code).
Example 2: The useful rexx library to unpack files "unzip32.dll" may (not) be available, but unzip.exe of various versions may (not) also be available, and/or unpack200.exe with OpenJDK. A wrapper function to unzip should be written to use whatever is available as we can't assume a baseline.

²) With Object REXX and ooRexx one can create a reusable "text library" to reference (compare to "include" in C/C++) with methods that can explore all possebilities and provide a unified way to unpack archives.

Code: [Select]
/* Purpose: Get information about the drive where the OS has been installed to */
/* Somewhat extended (and renamed) version of the one found in Rexx Tips & Tricks v3.60 */
/* Note the use of OS2ENVIRONMENT instead of just ENVIRONMENT as one can't assume a certain baseline version without forcing that one on others */
RxBootDrive: PROCEDURE EXPOSE (exposeList)

/* install a local error handler                  */
  SIGNAL ON SYNTAX NAME BootDrive

  boot_drive = ''
  boot_drive = SysBootDrive()

BootDrive:
/* boot_drive is still empty if SysBootDrive() failed */
/* SysBootDrive() is only available in the newer versions of REXXUTIL! */
    IF boot_drive = '' THEN
    DO
        /* Do further tests to ensure that the result of this method is correct! */
        PARSE UPPER VALUE VALUE( "PATH",, prog.__env ) WITH "\OS2\SYSTEM" -2 boot_drive +2
        boot_drive = STRIP( boot_drive )
        os_dir = STRIP( LEFT( VALUE( 'OSDIR',, 'OS2ENVIRONMENT' ), 2 ) )
        sys_cmd = STRIP( LEFT( VALUE( 'COMSPEC',, 'OS2ENVIRONMENT' ), 2 ) )
        IF LENGTH( os_dir ) = 2 & LENGTH( sys_cmd ) = 2 THEN
            IF os_dir = sys_cmd THEN RETURN os_dir
        IF LENGTH( os_dir ) = 2 THEN
            IF boot_drive = os_dir THEN RETURN boot_drive
        IF LENGTH( sys_cmd ) = 2 THEN
            IF boot_drive = sys_cmd THEN RETURN boot_drive
    END
RETURN boot_drive

15
List info related to programming in REXX
TitleType (Help/Tutorial/Reference/Guide/Examples/...)LocationFormat (pdf/inf/html/...)License (free/gpl 3/restricted/commercial/...)Interpreter (CRexx/ORexx/ooRexx/ARexx/BRexx/Regina/Roo)

Pages: [1] 2 3 ... 21