提交 57001500 编写于 作者: J James Lamb

Updated README.rst and included updated syntax to be more uniform with the other code

上级 001ff205
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册