[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

pfctl & MRTG - get daily network traffic



Hi,

	I'm trying to get MRTG network traffic graphs.
	I've done a script based on netstat to get the infos I wanted but I can't find how to to reset the counter each day...

	So I wanted to try with pfctl. I've tested
**********
> pfctl -s info
Status: Enabled  Time: 1017665536  Since: 1017223243  Debug: None
Bytes In IPv4: 193741221   Bytes Out: 169953142 
         IPv6: 0           Bytes Out: 0         
Inbound Packets IPv4:  Passed: 363003      Dropped: 1357      
                IPv6:  Passed: 0           Dropped: 0         
Outbound Packets IPv4: Passed: 355674      Dropped: 152       
                 IPv6: Passed: 0           Dropped: 0         
... blabla ...
> pfctl -F info
pf: statistics cleared
***********
	which gives Bytes In/Out (line#2) and reset the counters.

	Here're few questions:
	- are those values the correct ones to use when querying how many bytes passed trough the network interface ?
	- will the counter only apply to rules that "logs", or does it count "all bytes" ?
	- how could I get counter for specific rules ? let's say, how to get the traffic that went to any external port=80 ?

thX a lot for answers,
-----
ptiJo <ptiJo@noos.fr>

Il n'existe aucune limite, sacrée ou non, à l'action de l'homme dans l'univers.
Depuis les origines l'humanité a le choix être aveuglée par la verité ou coudre ses paupières.
Ce que le siècle des Grands Abattoirs nous aura appris devrait être inscrit au fronton de toutes les écoles:
Voici l'Homme. Le destructeur des Mondes est arrivé.
	No One Is Innocent