summaryrefslogtreecommitdiffstats
path: root/glances/plugins/ports/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'glances/plugins/ports/__init__.py')
-rw-r--r--glances/plugins/ports/__init__.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/glances/plugins/ports/__init__.py b/glances/plugins/ports/__init__.py
index 3b771d9d..2032b5ed 100644
--- a/glances/plugins/ports/__init__.py
+++ b/glances/plugins/ports/__init__.py
@@ -98,6 +98,10 @@ class PluginModel(GlancesPluginModel):
# Call the father class
super(PluginModel, self).exit()
+ def get_key(self):
+ """Return the key of the list."""
+ return 'indice'
+
@GlancesPluginModel._check_decorator
@GlancesPluginModel._log_result_decorator
def update(self):
@@ -120,10 +124,6 @@ class PluginModel(GlancesPluginModel):
return self.stats
- def get_key(self):
- """Return the key of the list."""
- return 'indice'
-
def get_ports_alert(self, port, header="", log=False):
"""Return the alert status relative to the port scan return value."""
ret = 'OK'
@@ -247,6 +247,10 @@ class ThreadScanner(threading.Thread):
# Is part of Ports plugin
self.plugin_name = "ports"
+ def get_key(self):
+ """Return the key of the list."""
+ return 'indice'
+
def run(self):
"""Grab the stats.
@@ -265,6 +269,8 @@ class ThreadScanner(threading.Thread):
# Scan an URL
elif 'url' in p and requests_tag:
self._web_scan(p)
+ # Add the key for every element
+ p['key'] = self.get_key()
@property
def stats(self):