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

Make zookeeper collector py26 compatible and bugfixes #221

Closed
wants to merge 1 commit into from
Closed

Make zookeeper collector py26 compatible and bugfixes #221

wants to merge 1 commit into from

Conversation

oozie
Copy link
Contributor

@oozie oozie commented Sep 20, 2015

The present zookeeper collector assumes python2.7. In addition to that, this change fixes

  • wrong assumptions made about exceptions being returned from subprocess,
  • supplying incorrect localhost address for opening socket.

BEFORE:

[root@oozie tcollector]# PYTHONPATH=. ./collectors/0/zookeeper.py 
Traceback (most recent call last):
  File "./collectors/0/zookeeper.py", line 140, in <module>
    sys.exit(main())    
  File "./collectors/0/zookeeper.py", line 101, in main
    instances = scan_zk_instances()
  File "./collectors/0/zookeeper.py", line 50, in scan_zk_instances
    listen_sock = subprocess.check_output(["netstat", "-lnpt"], stderr=subprocess.PIPE)
AttributeError: 'module' object has no attribute 'check_output'

AFTER:

[root@oozie tcollector]# PYTHONPATH=. ./collectors/0/zookeeper.py 
timed out
zookeeper.zk_avg_latency 1442708347 0 port=2181
zookeeper.zk_max_latency 1442708347 13 port=2181
zookeeper.zk_min_latency 1442708347 0 port=2181
zookeeper.zk_packets_received 1442708347 374 port=2181
zookeeper.zk_packets_sent 1442708347 373 port=2181
zookeeper.zk_num_alive_connections 1442708347 2 port=2181
zookeeper.zk_outstanding_requests 1442708347 0 port=2181
zookeeper.zk_approximate_data_size 1442708347 1217 port=2181
zookeeper.zk_open_file_descriptor_count 1442708347 23 port=2181

@vasiliyk
Copy link
Member

Merged upstream with commit 38a2b34. Thank you for contributing.

@vasiliyk vasiliyk closed this Oct 15, 2015
@johann8384 johann8384 added the bug label Feb 8, 2016
@johann8384 johann8384 added this to the 1.3.0 milestone Feb 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants