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

When parsing redis port, get last element after ':' instead of second #181

Merged
merged 1 commit into from Nov 11, 2014

Conversation

casey-green
Copy link
Contributor

The token parsed from netstat can take one of two forms: "0 0.0.0.0:6379" and ":::6379". If the for-loop hits the latter line first, then the line throws an exception. This modification ensures that both formats are supported.

I'm running this collector on Linux 3.2.30-49.59.amzn1.x86_64 EC2 box in AWS.

$ netstat --version
net-tools 1.60
netstat 1.42 (2001-04-15)

Here is an example output of the netstat command:

$ sudo netstat -tnlp
tcp        0      0 0.0.0.0:6379            0.0.0.0:*               LISTEN      7621/redis-server *
tcp6       0      0 :::6379                 :::*                    LISTEN      7621/redis-server *

The token parsed from netstat can take one of two forms: "0 0.0.0.0:6379" and ":::6379".  If the for-loop hits the latter line first, then the line throws an exception.  This modification ensures that both formats are supported.
@casey-green casey-green changed the title When parsing port, get last element after ':' instead of second When parsing redis port, get last element after ':' instead of second Nov 7, 2014
@johann8384 johann8384 added the bug label Nov 11, 2014
@johann8384 johann8384 self-assigned this Nov 11, 2014
johann8384 added a commit that referenced this pull request Nov 11, 2014
When parsing redis port, get last element after ':' instead of second
@johann8384 johann8384 merged commit 9f807e2 into OpenTSDB:master Nov 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants