Finding 3Connect's Log File?

Discussion in 'macOS' started by latency, Mar 11, 2010.

  1. latency macrumors newbie

    Joined:
    Mar 11, 2010
    #1
    Hi folks, long time reader, first time poster...

    -- The Short Version --

    I have mobile broadband from Three UK, and use their application 3Connect to manage the connection.

    Does anyone know where 3Connect's log file is, or how to go about finding it?

    It's not in any of the default locations listed in Console... unless I'm blind...

    Thanks!


    -- End Short Version --


    -- The Long Version --

    For long and complicated reasons, my primary internet connection is now a Three UK 3G Mobile Broadband adaptor.

    I've got this connected to my old MacMini G4 server, which shares the connection to my router, and thus, the rest of my stuff.

    It all works great, but I have a very limited bandwidth allowance, so I need a way of easily monitoring how much bandwidth I have remaining.

    I was thinking of writing a PHP script hosted from the server that reads the 3Connect log, and provides a read out of bandwidth used, remaining, and calculates daily allowances and so forth.

    To do this, I first need to find the log file of 3Connect, the application that handles the connection and monitors bandwidth.
    I've looked in all the default log directories listed in Console, but can't find it.

    Does anyone know where the 3Connect log is, or know how to go about finding it? Ta!

    -- End Long Version --
     
  2. vincentez macrumors newbie

    Joined:
    May 7, 2010
    #2
    been looking for the same answer. Here's what I discovered so far. The 3connect thing is an altered version of Birdstep's easyconnect software. On my computer, in d folder $home/Library/Preferences/com.birdstep.3uk.v1-data there are a few files: gbxrecord.plist, messages.database, update_params.plist and usage.database.

    I assume that d program saves it usage data in the usage.database file. Reading it out is a bit of a pain though. The file is in the sqlite format. Using the tool sqlite3_analyzer (from the sqlite website) I can read it out, but it hardly seems to produce any usable data. Here's an example:

    Code:
    BEGIN;
    CREATE TABLE space_used(
       name clob,        -- Name of a table or index in the database file
       tblname clob,     -- Name of associated table
       is_index boolean, -- TRUE if it is an index, false for a table
       nentry int,       -- Number of entries in the BTree
       leaf_entries int, -- Number of leaf entries
       payload int,      -- Total amount of data stored in this table or index
       ovfl_payload int, -- Total amount of data stored on overflow pages
       ovfl_cnt int,     -- Number of entries that use overflow
       mx_payload int,   -- Maximum payload size
       int_pages int,    -- Number of interior pages used
       leaf_pages int,   -- Number of leaf pages used
       ovfl_pages int,   -- Number of overflow pages used
       int_unused int,   -- Number of unused bytes on interior pages
       leaf_unused int,  -- Number of unused bytes on primary pages
       ovfl_unused int,  -- Number of unused bytes on overflow pages
       gap_cnt int       -- Number of gaps in the page layout
    );
    INSERT INTO space_used VALUES('QLP_SchemaTable','QLP_SchemaTable',0,12,12,446,0,0,50,0,1,0,0,522,0,0);
    INSERT INTO space_used VALUES('sessions','sessions',0,14,13,1191,0,0,93,1,2,0,1005,789,0,0);
    INSERT INTO space_used VALUES('sqlite_master','sqlite_master',0,2,2,385,0,0,208,0,1,0,0,521,0,0);
    COMMIT;
    Don't know what to do with that data just yet, not even sure if this is actually where the numbers are stored. I will keep ya posted.

    G'luck, vince
     
  3. vincentez macrumors newbie

    Joined:
    May 7, 2010
    #3
    making progress quickly here. Sqlite_analyzer was the wrong tool to be using here. The usage.database file is a database with one table in it, its called "sessions". In it, 3connect puts in an entry for each time you have been connected to the internet, listing the start time, total time, bytes sent, etc. The columns are, to be exact:

    sessions(ROWID INTEGER PRIMARY KEY,date_create QLDateTime,date_start QLDateTime,seconds QLNumber,bytes QLNumber,network_type TEXT,network_name TEXT,network_code TEXT);

    Using a simple shell command, I can tell the program sqlite to calculate the sum of all bytes sent. This would then be the total usage, in bytes. You can of course alter the SQL statement so that it calculates whatever you want.

    Code:
    echo 'SELECT SUM(bytes) FROM sessions;' | sqlite3 usage.database > test.txt
    This returns the total usage in bytes and prints them in a file test.txt. Divide by 1024 and you get the total kbytes :).
     

Share This Page