Whitespace changes
This commit is contained in:
parent
408e3d8ac9
commit
38ed83424c
@ -82,6 +82,7 @@ class jmx_query():
|
||||
url = self.get_url('hbase', hbase_active_master)
|
||||
self.get_jmx_data(url)
|
||||
|
||||
|
||||
def get_url(self, service, hostname):
|
||||
if (namenode_use_tls):
|
||||
url_scheme = "https://"
|
||||
@ -94,6 +95,7 @@ class jmx_query():
|
||||
url = url_scheme + hostname + ":" + str(hbase_master_ui_port) + "/jmx"
|
||||
return url
|
||||
|
||||
|
||||
def get_jmx_data(self, url):
|
||||
jmx = self.query(url)
|
||||
|
||||
@ -107,6 +109,7 @@ class jmx_query():
|
||||
|
||||
return True
|
||||
|
||||
|
||||
def get_active_namenode(hdfs_namenode_hosts):
|
||||
|
||||
if not which(cmd_hdfs_namenodes[0]):
|
||||
@ -157,6 +160,7 @@ class jmx_query():
|
||||
|
||||
return False
|
||||
|
||||
|
||||
def query(self, url):
|
||||
|
||||
try:
|
||||
@ -169,6 +173,7 @@ class jmx_query():
|
||||
jmx = flatten(jmx)
|
||||
return(jmx)
|
||||
|
||||
|
||||
def lookup_keys(self, key, value):
|
||||
if key.endswith("capacityUsed"):
|
||||
prom_hdfs_used.set(value)
|
||||
@ -211,6 +216,7 @@ class hbase_exporter():
|
||||
self.hbck_get_inconsistencies()
|
||||
self.check_health()
|
||||
|
||||
|
||||
def check_health():
|
||||
if self.num_inconsistencies > 0:
|
||||
prom_hbase_healthy.set(0)
|
||||
@ -225,6 +231,7 @@ class hbase_exporter():
|
||||
|
||||
return True
|
||||
|
||||
|
||||
@staticmethod
|
||||
def get_active_master():
|
||||
|
||||
@ -245,6 +252,7 @@ class hbase_exporter():
|
||||
prom_hbase_up.set(1)
|
||||
return r.stdout.decode('utf-8')
|
||||
|
||||
|
||||
def get_stale_regions_in_transition(self, hbase_master):
|
||||
host = hbase_master.rstrip("\n\r")
|
||||
port = hbase_master_ui_port
|
||||
@ -280,6 +288,7 @@ class hbase_exporter():
|
||||
|
||||
return num_regions_in_transition_stale
|
||||
|
||||
|
||||
def hbaseui_parse_output(self, content):
|
||||
soup = BeautifulSoup(content, 'html.parser')
|
||||
num_regions_in_transition_stale = 0
|
||||
@ -300,6 +309,7 @@ class hbase_exporter():
|
||||
except (AttributeError, TypeError):
|
||||
logging.info('Failed to parse HBase Master UI status page')
|
||||
|
||||
|
||||
def hbck_get_inconsistencies(self):
|
||||
re_status = re.compile(r'^Status:\s*(.+?)\s*$')
|
||||
re_inconsistencies = re.compile(r'^\s*(\d+)\s+inconsistencies\s+detected\.?\s*$')
|
||||
@ -342,6 +352,7 @@ class hbase_exporter():
|
||||
|
||||
self.num_inconsistencies = num_inconsistencies
|
||||
|
||||
|
||||
@staticmethod
|
||||
def hbaseui_parse_table(table):
|
||||
for row in table.findChildren('tr'):
|
||||
@ -352,6 +363,7 @@ class hbase_exporter():
|
||||
return num_regions_in_transition_stale
|
||||
return None
|
||||
|
||||
|
||||
def which(program):
|
||||
|
||||
def is_executable(fn):
|
||||
|
Loading…
Reference in New Issue
Block a user