2470 |
richard |
1 |
sqlcounter dailycounter {
|
|
|
2 |
sql_module_instance = sql
|
|
|
3 |
counter_name = Daily-Session-Time
|
|
|
4 |
check_name = Max-Daily-Session
|
|
|
5 |
reply_name = Session-Timeout
|
|
|
6 |
key = User-Name
|
|
|
7 |
reset = daily
|
2597 |
tom.houday |
8 |
query = "SELECT IFNULL((SELECT SUM(acctsessiontime - GREATEST((%%b - UNIX_TIMESTAMP(acctstarttime)), 0)) FROM radacct WHERE username='%{${key}}' AND UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '%%b'), 0)"
|
2470 |
richard |
9 |
}
|
|
|
10 |
|
|
|
11 |
sqlcounter monthlycounter {
|
|
|
12 |
sql_module_instance = sql
|
|
|
13 |
counter_name = Monthly-Session-Time
|
|
|
14 |
check_name = Max-Monthly-Session
|
|
|
15 |
reply_name = Session-Timeout
|
|
|
16 |
key = User-Name
|
|
|
17 |
reset = monthly
|
2597 |
tom.houday |
18 |
query = "SELECT IFNULL((SELECT SUM(acctsessiontime - GREATEST((%%b - UNIX_TIMESTAMP(acctstarttime)), 0)) FROM radacct WHERE username='%{${key}}' AND UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '%%b'), 0)"
|
2470 |
richard |
19 |
}
|
|
|
20 |
|
|
|
21 |
sqlcounter noresetcounter {
|
|
|
22 |
sql_module_instance = sql
|
|
|
23 |
counter_name = Max-All-Session-Time
|
|
|
24 |
check_name = Max-All-Session
|
|
|
25 |
key = User-Name
|
|
|
26 |
reset = never
|
2597 |
tom.houday |
27 |
query = "SELECT IFNULL(SUM(AcctSessionTime), 0) FROM radacct WHERE username='%{${key}}'"
|
2470 |
richard |
28 |
}
|
2510 |
tom.houday |
29 |
|
|
|
30 |
sqlcounter expire_on_login {
|
|
|
31 |
sql_module_instance = sql
|
|
|
32 |
counter_name = Alcasar-Expire-After-Initial-Login
|
|
|
33 |
check_name = Alcasar-Expire-After
|
|
|
34 |
key = User-Name
|
|
|
35 |
reset = never
|
2597 |
tom.houday |
36 |
query = "SELECT IFNULL((SELECT TIME_TO_SEC(TIMEDIFF(NOW(), acctstarttime)) FROM radacct WHERE username='%{${key}}' ORDER BY acctstarttime LIMIT 1), 0)"
|
2510 |
tom.houday |
37 |
}
|
2513 |
tom.houday |
38 |
|
|
|
39 |
sqlcounter counterCoovaChilliMaxTotalOctetsDaily {
|
|
|
40 |
sql_module_instance = sql
|
|
|
41 |
counter_name = CoovaChilli-Max-Total-Octets-Daily
|
|
|
42 |
check_name = CoovaChilli-Max-Total-Octets-Daily
|
|
|
43 |
counter_type = data
|
|
|
44 |
reply_name = CoovaChilli-Max-Total-Octets
|
|
|
45 |
key = User-Name
|
|
|
46 |
reset = daily
|
2597 |
tom.houday |
47 |
query = "SELECT IFNULL((SUM(AcctInputOctets + AcctOutputOctets)), 0) FROM radacct WHERE username='%{${key}}' AND UNIX_TIMESTAMP(AcctStartTime) + AcctSessionTime > '%%b'"
|
2513 |
tom.houday |
48 |
}
|
|
|
49 |
|
|
|
50 |
sqlcounter counterCoovaChilliMaxTotalOctetsMonthly {
|
|
|
51 |
sql_module_instance = sql
|
|
|
52 |
counter_name = CoovaChilli-Max-Total-Octets-Monthly
|
|
|
53 |
check_name = CoovaChilli-Max-Total-Octets-Monthly
|
|
|
54 |
counter_type = data
|
|
|
55 |
reply_name = CoovaChilli-Max-Total-Octets
|
|
|
56 |
key = User-Name
|
|
|
57 |
reset = monthly
|
2597 |
tom.houday |
58 |
query = "SELECT IFNULL((SUM(AcctInputOctets + AcctOutputOctets)),0) FROM radacct WHERE username='%{${key}}' AND UNIX_TIMESTAMP(AcctStartTime) + AcctSessionTime > '%%b'"
|
2513 |
tom.houday |
59 |
}
|