Forums

Paul Unger
Paul Unger
Offline
Resolved
0 votes
I'm using ClarkConnect Community Edition 5.0. On p. 209 of the ClarkConnect Administration Manual one finds this tantalising tidbit:
Reports are created through the ClarkConnect API using a dedicated MySQL database. This
makes extraction of the report logs simple to do in the event other report medium (ie. PDF) or
statistics are required.

I am very interested in generating a Web Proxy > User/IP Summary report for all my network users. I have installed the MySQLserver and the phpMyAdmin modules (which seem to be required pieces of the puzzle), but I don't know what to do from there. Can anyone help me? Thanks!

Aside 1: Report > Web Proxy Report > User/IP Summary shows only, for example, 1-30 / 41 users. Is there any way to show 1-41 / 41? The most I've ever been able to see is 30 users, but I'd like to see all users.

Aside 2: Report > Web Proxy Report > User/IP Summary seems to show only download MB rather than upload and download MB. Is there any way to show both? 'Total traffic' is more significant to me than just download traffic.
Sunday, March 07 2010, 07:05 PM
Share this post:
Responses (8)
  • Accepted Answer

    Wednesday, March 10 2010, 05:21 AM - #Permalink
    Resolved
    0 votes
    Good Luck - should be interesting...

    Had ClearOS used IBM's DB2 - then I could have helped you without effort...
    I do not use MySQL and for me there are more profitable things to learn...
    The reply is currently minimized Show
  • Accepted Answer

    Paul Unger
    Paul Unger
    Offline
    Wednesday, March 10 2010, 02:53 AM - #Permalink
    Resolved
    0 votes
    Hey, Tony--thanks for the other option. I think I'm going to try Ben's approach first, since I don't know how to complete your first instruction... or the second... :unsure: I may come back to this, though, if the other approach doesn't work. Thanks for hanging in there with me.
    The reply is currently minimized Show
  • Accepted Answer

    Paul Unger
    Paul Unger
    Offline
    Wednesday, March 10 2010, 02:41 AM - #Permalink
    Resolved
    0 votes
    Thanks for your reply, Ben. It looks like I could have spent a lot of time going nowhere, what with two MySQLs to access... I should let you know (if you haven't figured it out already) that I'm a complete noob at this. So herewith my questions:

    1. what does 'sandboxed' mean?
    2. it looks like I installed the "MySQL database server" module (at least that's the one listed in my Installation History on the Services > Software Modules page). Is that the correct one? Or do I need both? I don't see another MySQL module in the Services > Software Modules list...
    3. do I type "cat /etc/system/database" at a prompt on my server (is that what you mean by command line?)
    4. the passwords aren't really AAAAAAAAAAAAAA, CCCCCCCCCCCCCC, DDDDDDDDDDDDD, etc., correct? But I'm guessing that's a moot point as the one I really want is reports.password. I'll try what I think I understand and see what I come up with. ;)
    5. the code to access the MySQL console that you gave would be:
    /usr/share/system-mysql/usr/bin/mysql reports -ureports -pPASSWORD

    correct? I've just got to substitute 'reports' for DBNAME and USER? And the password that I retrieve from /etc/system/database, of course.

    Well, I'll see where this gets me and probably return to ask a few more questions. Thanks so much for the help!
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, March 10 2010, 01:28 AM - #Permalink
    Resolved
    0 votes
    Paul,

    One important piece of the puzzle that you're missing...there are actually two isolated installations of MySQL on a ClearOS box if you installed the app-mysql module. The one the web proxy uses is sandboxed.

    To access the database from the command line, you will need to fetch the database password:

    cat /etc/system/database

    password = AAAAAAAAAAAAAAA
    reports.password = PASSWORD
    zoneminder.password = CCCCCCCCCCCCCCC
    archive.password = DDDDDDDDDDDDD
    dspam.password = EEEEEEEEEEEEEE

    The proxy database password is keyed on 'reports.password'.

    Next, you'll need to access the MySQL console in a slightly different manner than the default MySQL server.

    /usr/share/system-mysql/usr/bin/mysql DBNAME -uUSER -pPASSWORD

    Where:

    DBNAME = reports
    USER = reports
    PASSWORD = the password retrieved from the /etc/system/database file

    Hope this helps
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, March 09 2010, 10:27 PM - #Permalink
    Resolved
    0 votes
    For web proxy reports by email, this is all I do on my servers...

    1. Install calamaris-2.29-4

    2. add the following line to cron using crontab -e while logged in as root..


    01 2 * * * /bin/cat /var/log/squid/access.log | /bin/nice -39 calamaris -amH 'daily worf' | /bin/mail -s "Daily Squid Report - server name" userid@somedomain.com


    To get the ClearOS generated mail report add the following as above...
     
    04 05 * * * /bin/cat /var/webconfig/reports/postfix/data-yesterday.out | /bin/mail -s "Mail Report" userid@somedomain.com


    Edit mail address and Serve name as required...

    Note in my two examples that should all be on one line for each one, Code Tags on this Site are not working properly and wrap - which they definitely should not do...l
    The reply is currently minimized Show
  • Accepted Answer

    Paul Unger
    Paul Unger
    Offline
    Tuesday, March 09 2010, 08:08 PM - #Permalink
    Resolved
    0 votes
    Thanks for your reply, Tony. I guess I don't have to use MySQL--it was just listed as a 'simple' solution. I've also tried ntop and netflow, but again, I don't know how to enable / configure what I need... Any help would still be appreciated.

    Paul
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, March 09 2010, 05:13 AM - #Permalink
    Resolved
    0 votes
    I didn't go that route so have no idea what is involved...

    I run an old version of calamaris that provides a mailed report daily giving very comprehensive reports for my web proxy including stats for TCP and UDP requests by host...
    The reply is currently minimized Show
  • Accepted Answer

    Paul Unger
    Paul Unger
    Offline
    Tuesday, March 09 2010, 03:40 AM - #Permalink
    Resolved
    0 votes
    So either my problem too simple (in which case I just need a gentle nudge in the right direction), or more complex than the manual indicates (in which case I need a lot of help)... Either way, I'm kind of surprised that no one has weighed in with some advice yet. I'd sure appreciate it! ;-)
    The reply is currently minimized Show
Your Reply