Skip to content
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

Ping windows #1532

Merged
merged 6 commits into from
Jul 25, 2016
Merged

Ping windows #1532

merged 6 commits into from
Jul 25, 2016

Conversation

marianob85
Copy link
Contributor

@marianob85 marianob85 commented Jul 21, 2016

Ping for windows

// So find a line contain 3 numbers except reply lines
var stats, aproxs []string = nil, nil
err := errors.New("Fatal error processing ping output")
stat := regexp.MustCompile("=\\W*(\\d+)\\D*=\\W*(\\d+)\\D*=\\W*(\\d+)")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rather than double-escaping everything, you should make these raw strings, like:

`=\W*(\d+)\D*=\W*(\d+)\D*=\W*(\d+)`

@sparrc
Copy link
Contributor

sparrc commented Jul 21, 2016

thanks @marianob85, looks good just a couple of comments and I can get it merged

this fixes #1433

@marianob85
Copy link
Contributor Author

Changes are made. Also rewrite little error handling. In case that no data was received (100% lost ), exit status from ping command is !=0 so there was not nice error on stderr.

@sparrc sparrc merged commit 0b3958d into influxdata:master Jul 25, 2016
@marianob85 marianob85 deleted the ping-windows branch July 25, 2016 17:01
aurrelhebert pushed a commit to aurrelhebert/telegraf that referenced this pull request Aug 9, 2016
* Ping for windows

* En ping output

* Code format

* Code review

* Default timeout

* Fix problem with std error when no data received ( exit status = 1 )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants