From: Michael Tremer Date: Sun, 10 May 2020 18:41:27 +0000 (+0100) Subject: Drop entropy plugin X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=98c9fd9d195f03e75e187bb8d203989c7b90995e;p=collecty.git Drop entropy plugin This is no longer useful. The Linux kernel has changed to only use the its internal PRNG for /dev/random and /dev/urandom. Once it is seeded, it will spit out as many random data as you would like, but would not require an entropy pool being filled up as much. Signed-off-by: Michael Tremer --- diff --git a/Makefile.am b/Makefile.am index 62657b5..7db6211 100644 --- a/Makefile.am +++ b/Makefile.am @@ -93,7 +93,6 @@ collectyplugins_PYTHON = \ src/collecty/plugins/cpufreq.py \ src/collecty/plugins/df.py \ src/collecty/plugins/disk.py \ - src/collecty/plugins/entropy.py \ src/collecty/plugins/__init__.py \ src/collecty/plugins/interface.py \ src/collecty/plugins/interrupts.py \ diff --git a/src/collecty/plugins/__init__.py b/src/collecty/plugins/__init__.py index 9f583a9..031a6d9 100644 --- a/src/collecty/plugins/__init__.py +++ b/src/collecty/plugins/__init__.py @@ -27,7 +27,6 @@ from . import conntrack from . import cpufreq from . import df from . import disk -from . import entropy from . import interface from . import interrupts from . import ipfrag diff --git a/src/collecty/plugins/entropy.py b/src/collecty/plugins/entropy.py deleted file mode 100644 index 352b6a3..0000000 --- a/src/collecty/plugins/entropy.py +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/python3 -############################################################################### -# # -# collecty - A system statistics collection daemon for IPFire # -# Copyright (C) 2012 IPFire development team # -# # -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU General Public License as published by # -# the Free Software Foundation, either version 3 of the License, or # -# (at your option) any later version. # -# # -# This program is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU General Public License for more details. # -# # -# You should have received a copy of the GNU General Public License # -# along with this program. If not, see . # -# # -############################################################################### - -import os - -from . import base - -from ..colours import * -from ..i18n import _ - -ENTROPY_FILE = "/proc/sys/kernel/random/entropy_avail" - -class GraphTemplateEntropy(base.GraphTemplate): - name = "entropy" - - @property - def rrd_graph(self): - _ = self.locale.translate - - return [ - "LINE2:entropy%s:%-15s" % (PRIMARY, _("Available entropy")), - "GPRINT:entropy_max:%12s\:" % _("Maximum") + " %5.0lf", - "GPRINT:entropy_min:%12s\:" % _("Minimum") + " %5.0lf", - "GPRINT:entropy_avg:%12s\:" % _("Average") + " %5.0lf\\n", - ] - - lower_limit = 0 - - @property - def graph_title(self): - _ = self.locale.translate - return _("Available entropy") - - @property - def graph_vertical_label(self): - _ = self.locale.translate - return _("Bit") - - -class EntropyObject(base.Object): - rrd_schema = [ - "DS:entropy:GAUGE:0:U", - ] - - @property - def id(self): - return "default" - - def collect(self): - with open(ENTROPY_FILE) as f: - return f.readline().strip() - - -class EntropyPlugin(base.Plugin): - name = "entropy" - description = "Entropy Plugin" - - templates = [GraphTemplateEntropy] - - @property - def objects(self): - if not os.path.exists(ENTROPY_FILE): - self.log.debug(_("Entropy kernel interface does not exist")) - return [] - - return [EntropyObject(self)]