W dniu 2014-02-02 23:05, Sławomir Paszkiewicz pisze:
W dniu 2012-04-16 15:54, Tomasz Chiliński pisze:
Cześć, Podgrzeje trochę temat, bo właśnie testuje u siebie accel-ppp. Ogólnie już mi to z grubsza działa, ale mam 2 problemy:
- Nie działa mi pobieranie wartości dla limitowania pasma, jak z cli
wpiszę ręcznie to jest OK 2. Czy ma ktoś z Was zrobione logowanie po PIN zamiast tworzenia dla każdego komputera innego hasła?
PS. Korzystam z domyślnego konfigura, który jest dołączony do LMS, jedynie zmieniłem "Mikrotik-Rate-Limit" na "Filter-Id"
SELECT 0 AS id, '%{User-Name}' AS UserName, 'Filter-Id' AS Attribute,\ CONCAT(ROUND(COALESCE(x.downceil, y.downceil, z.downceil)),'/', ROUND(COALESCE(x.upceil, y.upceil, z.upceil))) AS Value, ':=' AS op\ FROM (SELECT n.id, MIN(n.name) AS name, SUM(t.downceil/o.cnt) AS downceil, SUM(t.upceil/o.cnt) AS upceil\ FROM nodeassignments na JOIN assignments a ON (na.assignmentid = a.id) JOIN tariffs t ON (a.tariffid = t.id)\ JOIN nodes n ON (na.nodeid = n.id) JOIN (SELECT assignmentid, COUNT(*) AS cnt FROM nodeassignments GROUP BY assignmentid\ ) o ON (o.assignmentid = na.assignmentid) WHERE (a.datefrom <= unix_timestamp() OR a.datefrom = 0) \ AND (a.dateto > unix_timestamp() OR a.dateto = 0) AND a.suspended = 0 AND n.name = '%{User-Name}' AND n.warning=0\ GROUP BY n.id\ ) x\ LEFT JOIN (\ SELECT SUM(t.downceil)/o.cnt AS downceil,\ SUM(t.upceil)/o.cnt AS upceil\ FROM assignments a\ JOIN tariffs t ON (a.tariffid = t.id)\ JOIN nodes n ON (a.customerid = n.ownerid)\ JOIN (SELECT COUNT(*) AS cnt, ownerid FROM nodes \ WHERE NOT EXISTS (SELECT 1 FROM nodeassignments, assignments a \ WHERE assignmentid = a.id AND nodeid = nodes.id \ AND a.suspended = 0 AND (a.dateto > unix_timestamp() OR a.dateto = 0))\ GROUP BY ownerid \ ) o ON (o.ownerid = n.ownerid)\ WHERE (a.datefrom <= unix_timestamp() OR a.datefrom = 0) \ AND (a.dateto > unix_timestamp() OR a.dateto = 0) AND a.suspended = 0\ AND NOT EXISTS (SELECT 1 FROM nodeassignments WHERE assignmentid = a.id) \ AND n.name = '%{User-Name}'\ GROUP BY n.id\ ) y ON (1=1)\ RIGHT JOIN (SELECT n.id, n.name, 256 AS downceil, 256 AS upceil\ FROM ${authreply_table} n WHERE n.name = '%{User-Name}'\ ) z ON (1=1);"\
tylko musisz mieć w taryfie podczepiony komputer, bo będzie dawało 256/256 .