Subversion Repositories ALCASAR

Rev

Rev 2513 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

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