mirror of
https://github.com/shirou/gopsutil.git
synced 2025-04-26 13:48:59 +08:00
Updated README.rst and included updated syntax to be more uniform with the other code
This commit is contained in:
parent
001ff20588
commit
5700150054
@ -124,6 +124,11 @@ Several methods have been added which are not present in psutil, but will provid
|
||||
- system wide stats on network protocols (i.e IP, TCP, UDP, etc.)
|
||||
- sourced from /proc/net/snmp
|
||||
|
||||
- iptables nf_conntrack (linux only)
|
||||
|
||||
- system wide stats on netfilter conntrack module
|
||||
- sourced from /proc/sys/net/netfilter/nf_conntrack_count
|
||||
|
||||
Some codes are ported from Ohai. many thanks.
|
||||
|
||||
|
||||
@ -153,6 +158,7 @@ net_connections x x
|
||||
net_protocols x
|
||||
net_if_addrs
|
||||
net_if_stats
|
||||
netfilter_conntrack x
|
||||
================= ====== ======= ====== =======
|
||||
|
||||
Process class
|
||||
|
@ -65,8 +65,8 @@ type NetInterfaceStat struct {
|
||||
}
|
||||
|
||||
type NetFilterStat struct {
|
||||
ConnTrackCount int64 `json:"conntrackcount"`
|
||||
ConnTrackMax int64 `json:"conntrackmax"`
|
||||
ConnTrackCount int64 `json:"conn_track_count"`
|
||||
ConnTrackMax int64 `json:"conn_track_max"`
|
||||
}
|
||||
|
||||
var constMap = map[string]int{
|
||||
|
@ -165,8 +165,8 @@ func NetProtoCounters(protocols []string) ([]NetProtoCountersStat, error) {
|
||||
// the currently in use conntrack count and the max.
|
||||
// If the file does not exist or is invalid it will return nil.
|
||||
func NetFilterCounters() ([]NetFilterStat, error) {
|
||||
countfile := "/proc/sys/net/netfilter/nf_conntrack_count"
|
||||
maxfile := "/proc/sys/net/netfilter/nf_conntrack_max"
|
||||
countfile := common.HostProc("sys/net/netfilter/nf_conntrack_count")
|
||||
maxfile := common.HostProc("sys/net/netfilter/nf_conntrack_max")
|
||||
|
||||
count, err := common.ReadInts(countfile)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user