pingdom: new state
@@ -9,12 +9,15 @@ Configuration parameters:
app_key: create an APP KEY on pingdom first (default '')
cache_timeout: how often to refresh the check from pingdom (default 600)
checks: comma separated pindgom check names to display (default '')
- format: display format for this module (default '{output}')
+ format: display format for this module (default '{pingdom}')
login: pingdom login (default '')
max_latency: maximal latency before coloring the output (default 500)
password: pingdom password (default '')
request_timeout: pindgom API request timeout (default 15)
+Format placeholders:
+ {pingdom} pingdom response times
+
Color options:
color_bad: Site is down
color_degraded: Latency exceeded max_latency
@@ -34,7 +37,7 @@ class Py3status:
app_key = ''
cache_timeout = 600
checks = ''
- format = '{output}'
+ format = '{pingdom}'
login = ''
max_latency = 500
password = ''
@@ -42,7 +45,7 @@ class Py3status:
def pingdom_checks(self):
response = {'cached_until': self.py3.time_in(self.cache_timeout)}
- out = None
+ pingdom = None
# parse some configuration parameters
if not isinstance(self.checks, list):
@@ -60,7 +63,7 @@ class Py3status:
ck for ck in result['checks'] if ck['name'] in self.checks
]:
if check['status'] == 'up':
- out += '{}: {}ms, '.format(
+ pingdom += '{}: {}ms, '.format(
check['name'],
check['lastresponsetime']
)
@@ -68,12 +71,12 @@ class Py3status:
response['color'] = self.py3.COLOR_DEGRADED
else:
response['color'] = self.py3.COLOR_BAD
- out += '{}: DOWN'.format(
+ pingdom += '{}: DOWN'.format(
check['name'],
check['lastresponsetime']
)
- out = out.strip(', ')
- response['full_text'] = self.py3.safe_format(self.format, {'output': out})
+ pingdom = pingdom.strip(', ')
+ response['full_text'] = self.py3.safe_format(self.format, {'pingdom': pingdom})
return response
