summaryrefslogtreecommitdiffstats
path: root/collectors/python.d.plugin/isc_dhcpd
diff options
context:
space:
mode:
authorIlya Mashchenko <ilyamaschenko@gmail.com>2018-12-17 18:50:20 +0300
committerGitHub <noreply@github.com>2018-12-17 18:50:20 +0300
commit97b32703c63569812ef6652d8a8ab3a75f21990d (patch)
tree46bc67e074e839a9c1ecda640487d7102d16715d /collectors/python.d.plugin/isc_dhcpd
parent7ad91b8f9a840f7d8364a78dd396524c642ec786 (diff)
[python] make units compliant with IEC standard (#4995)
* apache units fix * beanstalk * bind_rndc * boinc * ceph * chrony * couchdb * dns_query * dnsdist * dockerd * dovecot * elasticsearch by @vlvkobal <3 * example * exim * fail2ban * freeradius minor fixes * freeradius minor fixes * freeradius minor fixes * go_expvar * haproxy * hddtemp * httpcheck * icecast * ipfs * isc_dhcpd * litespeed * logind * megacli * memcached * mongodb * monit * mysql * nginx * nginx_plus * nsd * ntpd * nvidia_smi * openldap * ovpn_status * phpfm * portcheck * postfix * postgres * powerdns * proxysql * puppet * rabbitmq * redis * restroshare * samba * sensors * smartdlog * spigotmc * springboot * squid * retroshare * tomcat * retroshare * tor * traefik * traefik * unbound * uwsgi * varnish * w1sensor * web_log * ok codacy * retroshare * ipfs
Diffstat (limited to 'collectors/python.d.plugin/isc_dhcpd')
-rw-r--r--collectors/python.d.plugin/isc_dhcpd/isc_dhcpd.chart.py30
1 files changed, 21 insertions, 9 deletions
diff --git a/collectors/python.d.plugin/isc_dhcpd/isc_dhcpd.chart.py b/collectors/python.d.plugin/isc_dhcpd/isc_dhcpd.chart.py
index a9f2749491..bbe7a93696 100644
--- a/collectors/python.d.plugin/isc_dhcpd/isc_dhcpd.chart.py
+++ b/collectors/python.d.plugin/isc_dhcpd/isc_dhcpd.chart.py
@@ -19,14 +19,16 @@ from copy import deepcopy
from bases.FrameworkServices.SimpleService import SimpleService
-priority = 60000
-retries = 60
-ORDER = ['pools_utilization', 'pools_active_leases', 'leases_total']
+ORDER = [
+ 'pools_utilization',
+ 'pools_active_leases',
+ 'leases_total',
+]
CHARTS = {
'pools_utilization': {
- 'options': [None, 'Pools Utilization', '%', 'utilization', 'isc_dhcpd.utilization', 'line'],
+ 'options': [None, 'Pools Utilization', 'percentage', 'utilization', 'isc_dhcpd.utilization', 'line'],
'lines': []
},
'pools_active_leases': {
@@ -120,7 +122,6 @@ class Service(SimpleService):
SimpleService.__init__(self, configuration=configuration, name=name)
self.order = ORDER
self.definitions = deepcopy(CHARTS)
-
lease_path = self.configuration.get('leases_path', '/var/lib/dhcp/dhcpd.leases')
self.dhcpd_leases = DhcpdLeasesFile(path=lease_path)
self.pools = list()
@@ -131,7 +132,7 @@ class Service(SimpleService):
def check(self):
if not HAVE_IP_ADDRESS:
- self.error("'python-ipaddress' module is needed")
+ self.error("'python-ipaddress' package is needed")
return False
if not self.dhcpd_leases.is_valid():
@@ -190,6 +191,17 @@ class Service(SimpleService):
def create_charts(self):
for pool in self.pools:
- self.definitions['pools_utilization']['lines'].append([pool.id + '_utilization', pool.name,
- 'absolute', 1, 100])
- self.definitions['pools_active_leases']['lines'].append([pool.id + '_active_leases', pool.name])
+ dim = [
+ pool.id + '_utilization',
+ pool.name,
+ 'absolute',
+ 1,
+ 100,
+ ]
+ self.definitions['pools_utilization']['lines'].append(dim)
+
+ dim = [
+ pool.id + '_active_leases',
+ pool.name,
+ ]
+ self.definitions['pools_active_leases']['lines'].append(dim)