+7 (916) 741 5495
support@netams.com

                         english   

 

service quota


:
  1. SQL. MySQL Postgres.
  2. (), .
  3. . , , , .
  4. " " "" .
  5. .
NeTAMS.

, MySQL, data-source 2:
	service data-source 2
	type mysql
quota - :
	service quota 0
	storage 2
NeTAMS. . , , :
  1. -
  2. SQL- NeTAMS: mysqlshow netams ( "quota")
  3. telnet- show quota
quota telnet-,
	service quota 0
. : ( ) , ( SQL-).

policy XXX
(acct-policy), . , . , policy XXX processor.

block-policy XXX
(fw-policy), . , . sys-deny-quota. " " .

!
QUOTA . "" NeTAMS QUOTA, . 3.2.0, 3.2.1 STABLE 10.02.2005, . SQL-:
alter table quota add column block_policy INT default 0;
alter table quota add column block_policy_flags INT default 0;

soft-treshold N
" " , " ". ( " , "), . src/netams.h (S_QUOTA_DEF_soft_treshold) 80%. 0 100, "%" . "0" " " .

delay N
. . 10 ., src/netams.h (S_QUOTA_DEF_delay).

storage N
storage, quota. () .

set {name XXX | oid YYY} [policy XXX] [block-policy XXX] [soft-treshold N] [active|inactive] [notify [{soft|hard|return} {"{none}"|["{owner}"] [YYY]}]] [hour ... ] [day ...] [week ...] [month ...]
. policy, soft-treshold notify , . quota SQL-, .
  • name XXX | oid YYY}
    OID , . .
  • policy XXX
    (acct-policy), . .
  • block-policy XXX
    (fw-policy), . .
  • soft-treshold N
    " " , " ". "0" " " . 0 100.
  • active|inactive
    . , . " ".
  • notify {_} {}
    , , .
    ({_}) - :
        soft - "" . , .
        hard - "" . , , .
        return - (, ) .

    ({}) - , . / ( user email), (user), . :
    • {owner} -
    • username - OID ().
    ( user name admin email root@localhost ):
    notify soft {owner}
    notify hard {owner} admin
    notify return admin
    
  • [hour ... ], [day ...], [week ...], [month ...]
    . :
        time_spec amount {in|out|sum},
    timespec={hour|day|week|month}, amount - ( , K, M, G), {in|out} - , {sum} - ( ). , 0. :
    set name user1 month 0 in
    
    .
src/netams.h (make clean; make). :
#define S_QUOTA_DEF_soft_treshold 80
#define S_QUOTA_DEF_delay 10
#define S_QUOTA_DEF_notify_soft 1
#define S_QUOTA_DEF_notify_hard 1
#define S_QUOTA_DEF_notify_return 1
set ... (, u->quotadata u), quota SQL- . , , . mysqlshow netams quota. SQL- quota . telnet- ( set).

. :
  1. FreeBSD 4.7 / NeTAMS 3.1(2176)
  2. 10 192.168.0.X
  3. , 3 100 .
  4. (75%), , - .
  5. HTTP-.
NeTAMS:
debug none
user oid 01327B name admin real-name Konstantin email AAA@mail.ru permit all
schedule oid 08FFFF time hourly- action html

#services configuration

service server 0
login any
listen 20001
max-conn 6

service processor 0
lookup-delay 20
flow-lifetime 60
policy oid 146633 name all-ip target proto ip 
policy oid 147C83 name http target proto tcp ports 80 8080 81 3128 443 
restrict all pass local pass
unit group oid 0574B0 name LAN acct-policy all-ip 
unit group oid 05431B name WAN acct-policy all-ip 
unit host oid 021949 name server ip 192.168.0.1 acct-policy all-ip 
unit host oid 02238E name Andrew ip 1.3.168.142 acct-policy all-ip http
unit net oid 0446E8 name local ip 192.168.0/24 acct-policy all-ip 
unit net oid 043D1B name all ip 0.0.0.0 mask 0.0.0.0 acct-policy all-ip 
unit host oid 02507E name 02 ip 192.168.0.10 acct-policy all-ip http 
unit host oid 022EB1 name 03 ip 192.168.0.11 acct-policy all-ip http 
unit host oid 0241B7 name 07 ip 192.168.0.12 acct-policy all-ip http
unit host oid 0279E2 name 09 ip 192.168.0.13 acct-policy all-ip http
unit host oid 027545 name 11 ip 192.168.0.14 acct-policy all-ip http
unit host oid 02515F name 12 ip 192.168.0.15 acct-policy all-ip http
unit user oid 025BD0 name 13_1 ip 192.168.0.16 
	email user08@a.ru acct-policy all-ip http
unit host oid 021220 name 14 ip 192.168.0.17 acct-policy all-ip http
unit user oid 024DB1 name 13_2 ip 192.168.0.18 
	email user09@a.ru acct-policy all-ip http
unit host oid 020216 name 16 ip 192.168.0.19 acct-policy all-ip http
unit host oid 021F16 name 17 ip 192.168.0.20 acct-policy all-ip http
unit host oid 021190 name 50_1 ip 192.168.0.21 acct-policy all-ip http
unit host oid 0266EF name Localnet ip 192.168.0.22 acct-policy all-ip http
unit host oid 02140E name TPSO-1 ip 192.168.0.23 acct-policy all-ip http
unit host oid 023352 name TPSO-2 ip 192.168.0.24 acct-policy all-ip http
unit host oid 02109C name 07-2 ip 192.168.0.25 acct-policy all-ip http
unit host oid 020DED name 19 ip 192.168.0.26 acct-policy all-ip http
unit user oid 027FDC name 15_1 ip 192.168.0.27 
	email user05@a.ru acct-policy all-ip http
unit user oid 021BEF name 15_2 ip 192.168.0.28 
	email user02@a.ru acct-policy all-ip http
unit user oid 0241A7 name 15_3 ip 192.168.0.29 
	email user04@a.ru acct-policy all-ip http
unit user oid 026B68 name 15_4 ip 192.168.0.30 
	email user06@a.ru acct-policy all-ip http
unit host oid 024E6A name 08_1 ip 192.168.0.31 acct-policy all-ip http
storage 1 all

service storage 1
type mysql

service quota 0
policy http
soft-treshold 75
notify soft {owner} 
notify hard {owner} admin
notify return {owner} 
storage 1

service data-source 1
type ip-traffic
source divert 199
rule 5 "ip from any to any via rl0"

service alerter 1
report oid 06100 name rep1 type traffic period day detail simple
smtp-server localhost

service html 1
path /home/www/traffic
language en
run hourly
NeTAMS/SQL . netamsctl :
netamsctl "service quota 0 && set name 12 day 3M in month 150M in && exit"
netamsctl "service quota 0 && set name 13_1 day 3M in month 100M in && exit"
netamsctl "service quota 0 && set name 13_2 day 3M in month 100M in && exit"
netamsctl "service quota 0 && set name 15_1 day 3M in month 100M in && exit"
netamsctl "service quota 0 && set name 15_2 day 3M in month 120M in && exit"
netamsctl "service quota 0 && set name 15_3 day 3M in month 100M in && exit"
netamsctl "service quota 0 && set name 15_4 day 3M in month 100M in && exit"
NeTAMS SQL, save . - Admintool .

[an error occurred while processing this directive]