• MiamiDxStatus.rexx

    From Neil Williams@1:2320/100 to All on Tue Feb 5 17:23:02 2002
    1.71.5.204-B20160823
    Hi,

    Here's something a bit funky.

    My BBS machine back at home delivers me a daily status report of what it's
    been doing, what machines on the LAN have been doing, time spent on the internet collecting mail, uptimes, memory fragmentation, etc. etc. (you'll
    have seen some of the scripts I use posted in here).

    I realised today that one thing I'd like to know about which wasn't being reported. I always have the MiamiDx control panel open on Workbench so I can see what activity is going on and how much data has been sent over the
    network -it'd be nice to have a snapshot of this delivered to me with the
    daily report. I considered (for 5 seconds) using SGrab to capture the window and the file attach the picture. Then I came to my senses and wrote the following script in a couple of minutes :)

    Oh, but it hasn't been tested with interfaces which have transfered over 1GB. That may not work correctly, but *looks* okay.


    It outputs to stdout, so redirect it into logfiles or similar.

    [rx] MiamiDxStatus[.rexx] >>Logs:WhatsMiamiDoingThen?.log


    -8<-[MiamiDxStatus.rexx]-------------------------------------
    /* Output a list of Miami interfaces and their states,
    * much like a snapshot of the MiamiDx Control Panel.
    *
    * Neil Williams, neil@zeusdev.co.uk
    * 5/2/2002
    */

    options results
    parse arg args

    address MIAMI.1

    /* vv CONFIGURE ME HERE vv */

    iface.count = 3

    iface.0.name = 'eth0'
    iface.0.desc = 'LAN'
    iface.1.name = 'ppp0'
    iface.1.desc = 'Freeserve'
    iface.2.name = 'ppp6'
    iface.2.desc = 'Psion'

    /* ^^ CONFIGURE ME HERE ^^ */

    say 'Name State Connect Bytes Time'

    do i = 0 to iface.count-1
    str = left( iface.i.name, 10 )

    IsOnline iface.i.name
    if RC = 1 then
    str = str || ' Online '
    else
    str = str || ' Offline '

    GETCONNECT iface.i.name
    str = str || left( RESULT, 10 )

    GetTransferedBytes iface.i.name
    n = RESULT
    if word( n, 1 ) == 0 then
    if word( n, 2 ) < 1024*1024 then
    str = str || ' ' || right( word(n,2)%1024 || 'KB', 8 ) || ' '
    else
    str = str || ' ' || right( word(n,2)%(1024*1024) ||'.'|| left(word(n,2)//(1024*1024), 2) ||'MB', 8 ) || ' '
    else
    str = str || ' ' || right( word(n,1) ||'.'|| left(word(n,2)//(1024*1024),
    2) || 'GB', 8 ) || ' '

    GETCONNECTTIME iface.i.name
    if result < 60 then
    str = str || result || ' sec'
    else
    if result % 60 > 60 then
    str = str || (result % 60)%60 ||'h'|| right( (result % 60)-((result % 60)%60)*60, 2, '0' )
    else
    str = str || result % 60 ||'.'|| right( result // 60, 2, '0' )

    say str

    end
    -8<---------------------------------------------



    --
    Neil Williams aka nOw2 - CompSci - Fido 2:442/107 - SysOp of TKG BBS
    http://www.tkgbbs.freeserve.co.uk/ <- Links to most things
    --- Mail Manager 1.22x/n #1511
    # Origin: 9,600 bps (2:442/107.20)
    * Origin: LiveWire BBS - Synchronet - LiveWireBBS.com (1:2320/100)
  • From Benny Pedersen@1:2320/100 to Neil Williams on Thu Feb 7 03:16:02 2002
    1.71.5.204-B20160823
    Hi Neil Williams

    you wrote about "MiamiDxStatus.rexx":


    It outputs to stdout, so redirect it into logfiles or similar.
    [rx] MiamiDxStatus[.rexx] >>Logs:WhatsMiamiDoingThen?.log

    geniuos :-)

    could you make a new rexx version of foxgate ?

    that use xadmaster for base64 decode ? :-)

    and the packing is do just as a lha packer, eg users can from areafix change packer and delivery at remote ? :-)

    wish i could do arexx power scripts, i just got the idea :-)



    Benny Pedersen http://xpoint.ldnet.dk/ icq:36248146


    ...If you understand what you're doing, you're not learning anything.

    --- PINT/2.2 (beta6) (31.10.98)
    # Origin: xpoint@worldonline.dk (2:237/38)
    * Origin: LiveWire BBS - Synchronet - LiveWireBBS.com (1:2320/100)