From: Valentina Giusti <valentina.giusti@xxxxxxxxxxxx> Signed-off-by: Valentina Giusti <valentina.giusti@xxxxxxxxxxxx> Cc: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx> Cc: Patrick McHardy <kaber@xxxxxxxxx> Cc: Jozsef Kadlecsik <kadlec@xxxxxxxxxxxxxxxxx> Cc: "David S. Miller" <davem@xxxxxxxxxxxxx> --- nfacct.8 | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/nfacct.8 b/nfacct.8 index 0c3249c..8cc79b7 100644 --- a/nfacct.8 +++ b/nfacct.8 @@ -30,6 +30,65 @@ Delete accounting object. .BI "get " Get existing accounting object. .TP +.BI "notify " +Get notifications for existing accounting object. +Notifications can be sent either periodically, with the option "period", or +based on the amount of accounted bytes or packets, with the options "bytes" +and "packets", respectively. + +For example, a notification every 1024 bytes can be requested for the accounting +object "http-traffic": +.in +4n +.nf + +.RB "$" "nfacct notify http-traffic bytes 1024" +{ pkts = 00000000000000039225, bytes = 00000000000002361568 } = http-traffic; +{ pkts = 00000000000000039245, bytes = 00000000000002362608 } = http-traffic; + ... +.fi +.in + +or every 100 packets: + +.in +4n +.nf +.RB "$" "nfacct notify http-traffic packets 100" +{ pkts = 00000000000000008303, bytes = 00000000000000486469 } = http-traffic; +{ pkts = 00000000000000008403, bytes = 00000000000000494581 } = http-traffic; + ... +.fi +.in + +or every 2 minutes: + +.in +4n +.nf +.RB "$" "nfacct notify http-traffic period 120" +{ pkts = 00000000000000013133, bytes = 00000000000000796388 } = http-traffic; +{ pkts = 00000000000000015459, bytes = 00000000000000952884 } = http-traffic; + ... +.fi +.in + +Notification requests can specify at the same time a traffic target (bytes or +packets) and a time target (period). In this case, additional parameters are +available, which allow to set a limit for the amount of notifications based on +accounted packets or bytes to be sent during a single period: + +.in +4n +.nf +.RB "$" "nfacct notify http-traffic bytes 1024 bytes-ratelimit 4 period 5" +{ pkts = 00000000000000010172, bytes = 00000000000000628714 } = http-traffic; +{ pkts = 00000000000000010192, bytes = 00000000000000629754 } = http-traffic; +{ pkts = 00000000000000010212, bytes = 00000000000000630794 } = http-traffic; +{ pkts = 00000000000000010232, bytes = 00000000000000631834 } = http-traffic; +{ pkts = 00000000000000010894, bytes = 00000000000000672343 } = http-traffic; + ... +.fi +.in + +.PP +.TP .BI "flush " Delete all unused accounting objects. .TP -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html