Skip to content

Commit 36f4d58

Browse files
authored
Merge pull request #1 from brad-lewis/analytics
Connstat output meets requirement of TCP Collector
2 parents 5c4e562 + 74fd513 commit 36f4d58

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

usr/cmd/connstat

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,12 @@ def connstat_regurgitate():
117117
for line in open('/proc/net/stats_tcp'):
118118
line_str_list = line.strip().split(',')
119119

120-
# Skip filtered out lines; not the headings(first) line
120+
# Omit headings(first) line for parsable output
121+
if args.parsable and headings_line:
122+
headings_line = False
123+
continue
124+
125+
# Skip filtered out lines; doesn't apply to headings
121126
if not headings_line and (loopback_skip(line_str_list)
122127
or filter_skip(line_str_list)):
123128
continue
@@ -204,8 +209,10 @@ if args.parsable:
204209

205210
while True:
206211
if args.TYPE is 'u':
212+
print ("=", end =" ")
207213
print (time.time())
208214
elif args.TYPE is 'd':
215+
print ("=", end =" ")
209216
os.system("date")
210217

211218
connstat_regurgitate()

0 commit comments

Comments
 (0)