Skip to content

Commit

Permalink
Updated README.rst and included updated syntax to be more uniform wit…
Browse files Browse the repository at this point in the history
…h the other code
  • Loading branch information
jlambatl committed Dec 8, 2015
1 parent 001ff20 commit 5700150
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.


Expand Down Expand Up @@ -153,6 +158,7 @@ net_connections x x
net_protocols x
net_if_addrs
net_if_stats
netfilter_conntrack x
================= ====== ======= ====== =======

Process class
Expand Down
4 changes: 2 additions & 2 deletions net/net.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
4 changes: 2 additions & 2 deletions net/net_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 5700150

Please sign in to comment.