-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add netstat_poller #68
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good. Just left one comment.
fields := map[string]int{ | ||
"tcp_established": counts["ESTABLISHED"], | ||
"tcp_syn_sent": counts["SYN_SENT"], | ||
"tcp_syn_recv": counts["SYN_RECV"], | ||
"tcp_fin_wait1": counts["FIN_WAIT1"], | ||
"tcp_fin_wait2": counts["FIN_WAIT2"], | ||
"tcp_time_wait": counts["TIME_WAIT"], | ||
"tcp_close": counts["CLOSE"], | ||
"tcp_close_wait": counts["CLOSE_WAIT"], | ||
"tcp_last_ack": counts["LAST_ACK"], | ||
"tcp_listen": counts["LISTEN"], | ||
"tcp_closing": counts["CLOSING"], | ||
"tcp_none": counts["NONE"], | ||
"udp_socket": counts["UDP"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if one of these counts[KEY_NAME]
is not present on the map? Are we confident these headings are the same across different distros and/or OSes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question, this library is providing this interface https://github.com/shirou/gopsutil - even if the value is 0 the count field and label is still there. These are all standard tcp connection state machine states so these should be consistent across all OSes and distros.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my opinion, we can focus on linux and leave windows aside. If someone really wants to run shh on windows, they are my guest to fix it if the netstat poller would become a problem.
Is the snyk warning due to a GPL component that this PR introduced? |
Hi Tilman, no this warning is occurring outside of this PR. I have created another PR to test and confirm which you can see here: https://github.com/heroku/shh/runs/6296402764?check_suite_focus=true |
This PR introduces a new poller which aggregates netstat connection information.