Author Topic: Using REXX to monitor TCP/IP and other statistics?  (Read 1269 times)

RobertM

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2034
    • View Profile
    • A.I.BuiltPC - using OS/2 Warp Server & eComStation for Custom Web and Database Solutions
Hi, does anyone know how I can use REXX to get the following information? Inotherwords, a particular DLL Library I need? Something in the poorly documented RxSocks?

- TCP/IP traffic stats (similar to what the widget in xCenter/eCenter reports: current upload/download speeds and amounts)
- Active network/socket connections (ie: 47 connections to port 80)
- A tool that returns *VALID* data for the amount of available, free and used memory in the system (I'm getting all sorts of interesting results with the ones I am trying).

Best,
Rob
|
|
Kirk's 5 Year Mission Continues at:
Star Trek New Voyages
|
|


herwigb

  • Full Member
  • ***
  • Posts: 115
    • View Profile
Re: Using REXX to monitor TCP/IP and other statistics?
« Reply #1 on: 2012.04.08, 13:41:35 »
Take a look at this http://www.os2usr.org/xcenter/hbtcpipgraphmon202.zip - this could be a starting point for what you want to do.
Kind regards,
HerwigB.

RobertM

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2034
    • View Profile
    • A.I.BuiltPC - using OS/2 Warp Server & eComStation for Custom Web and Database Solutions
Re: Using REXX to monitor TCP/IP and other statistics?
« Reply #2 on: 2012.04.09, 03:38:46 »
Take a look at this http://www.os2usr.org/xcenter/hbtcpipgraphmon202.zip - this could be a starting point for what you want to do.

Hi Herwig,

With a little work, I can probably use that. The only problem I am running into is that there seems to be an integer overflow in the memory calculations. The system has 4GB of physical RAM in it. Here are the results:


Mem1 - Total number of bytes of physical memory:                                      -,671,776,768
Mem2 - Total number of bytes of system-resident memory:                                 109,056,000
Mem3 - Maximum number of bytes available for all processes in the system RIGHT NOW:  -1,236,000,768
Mem4 - Maximum number of bytes available for this process RIGHT NOW:                    386,269,184
Mem5 - Maximum number of shareable bytes available RIGHT NOW:                           332,267,520



Here's what pyRxUtil reports - some of which seems correct:

(QSV_TOTPHYSMEM)  Avail.phys.mem  - 3,623,190,528 Bytes
(QSV_TOTRESMEM)   Avail.resid.mem -   109,084,672 Bytes
(QSV_TOTAVAILMEM) Total.avail.mem - 2,993,901,568 Bytes


Now, note this math:

4,294,967,296 (4GB installed RAM)
 -671,776,768
--------------
3,623,190,528 On the button, exactly the same answer as pyRxUtil


After taking into account resources for device mappings, that seems about right.

The value I have labeled as "Mem3" I think requires the same thing for negative numbers. The differences between it and pyRx are 60 something MB, which could be accounted for because the data was copied at slightly different times on an active web server.

So, I think it should be suitably usable for me.



But, now I have a question - what do the values of these really correspond to?
- Value 18 (QSV_TOTRESMEM   ) - #2 above
- Value 20 (QSV_MAXPRMEM) - #4 above
- Value 21 (QSV_MAXSHMEM) - #5 above


I know 20 is supposed to be the private arena and 21 is supposed to be the shared arena (or at least, I'm pretty sure), but the numbers of all three (or at least 18 and 20) don't make much sense when taken together with everything else.

The machine has a VIRTUALADDRESSLIMIT value set at 1800. From system start, with nothing but the OS and its services running, those numbers are pretty much what you see above (a few dozen megabyte difference).

I'd have thought, even with fragmentation and such, that the resources would add up better - and that one of the arenas would have a lot more (private).

Any thoughts from anyone would be greatly appreciated.

Best,
Rob
|
|
Kirk's 5 Year Mission Continues at:
Star Trek New Voyages
|
|


RobertM

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2034
    • View Profile
    • A.I.BuiltPC - using OS/2 Warp Server & eComStation for Custom Web and Database Solutions
Re: Using REXX to monitor TCP/IP and other statistics?
« Reply #3 on: 2012.04.10, 02:24:29 »
So... here's a particular question that's baffling. What does this value correspond to, and why is it so low?

(QSV_TOTRESMEM)   Avail.resid.mem -   109,084,672 Bytes

Resident in what fashion? It's obviously not "how much physical memory exists" nor "how much memory does OS/2 see" - and it doesn't seem to be shared memory available either (that's supposedly #5 on my earlier post (QSV_MAXSHMEM)).

Sorry gang, I know these seem like newbie questions... I mean I know about the various memory arenas in OS/2 - but the way DosQuerySysInfo has them named or reports them isn't helping me make a connection to what they actually pertain to - which is making it difficult for me to use them to watch what resources the server is running low on.

Here's some information on what memory I do know is being used, as per the values I have assigned:
- JFS:                                32,768 bytes for cache
- HPFS386:                             8,192 bytes for cache
- VirtualAddressLimit:                 1,800 MB



And here are some values I have set for other OS parameters that affect the amount of memory available:
-Threads:                              1,000
-ShellHandlesInc:                      1,024
-Buffers:                                 10  
-Files:                                   40  
-DiskCache:                         64,LW,16  
-Swap File Size:                      65,535
 (side note, I've had interesting results with swap files of near any size on systems with 4GB) ???

-Processes:                        REM'D OUT


Any thoughts would be greatly appreciated.

Best,
Rob
|
|
Kirk's 5 Year Mission Continues at:
Star Trek New Voyages
|
|


RobertM

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2034
    • View Profile
    • A.I.BuiltPC - using OS/2 Warp Server & eComStation for Custom Web and Database Solutions
Re: Using REXX to monitor TCP/IP and other statistics?
« Reply #4 on: 2012.04.10, 04:27:15 »
I guess the more important question is "which are the most important values for AMP?" ;)

So... if anyone knows the best way I should configure such things, I'd greatly appreciate it.

Best,
Rob
|
|
Kirk's 5 Year Mission Continues at:
Star Trek New Voyages
|
|