Integrating with FreeRADIUS (MySQL)

Discussion in 'Optigold ISP' started by Sam at DoorPI, Jul 23, 2004.

  1. #1
    Just wondering if anyone has done this before. I'm trying to get Optigold to import usage stats from a server running the latest ver of FreeRadius and MySQL.

    The date format doesn't seem to match up between the radacct table and Optigold's "SQL Statement to View Usage History"

    I've been using PuTTY to login and run an SQL query to get usage info up to this point. (Serious pain in the neck)
     
    Sam at DoorPI, Jul 23, 2004 IP
  2. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #2
    What date format is it in on your end?
     
    digitalpoint, Jul 23, 2004 IP
  3. Sam at DoorPI

    Sam at DoorPI Guest

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Date example: 2004-03-30 13:15:09

    Here's an SQL query I had tried for the monthly usage:
    SELECT login,count(login),sum(seconds),sum(bandwidth) FROM usagetable WHERE date >= '<Y1>-<M1>-<D1>' AND date <= '<Y2>-<M2>-<D2>' GROUP BY login

    I think the hh:mm:ss format is throwing it off.
     
    Sam at DoorPI, Jul 23, 2004 IP
  4. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #4
    If that's the case, you could hard code a time... like so:

    SELECT login,count(login),sum(seconds),sum(bandwidth) FROM usagetable WHERE date >= '<Y1>-<M1>-<D1> 00:00:00' AND date <= '<Y2>-<M2>-<D2> 00:00:00' GROUP BY login
    Code (markup):
     
    digitalpoint, Jul 23, 2004 IP