GhostManSec
Server: Apache
System: Linux 57.167.178.68.host.secureserver.net 3.10.0-1160.118.1.el7.x86_64 #1 SMP Wed Apr 24 16:01:50 UTC 2024 x86_64
User: countrycraft1 (1001)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib/fm-agent/plugins/entropy.py
import agent_util
import os
import re
import sys
from agent_util import float

class EntropyPlugin(agent_util.Plugin):
    textkey = "entropy"
    label = "Entropy"

    @classmethod
    def get_metadata(self, config):
        status = agent_util.SUPPORTED
        msg = None
        if not os.path.exists("/proc/sys/kernel/random/entropy_avail"):
            status = agent_util.UNSUPPORTED
            msg = "/proc/sys/kernel/random/entropy_avail does not exist."

        data = {
            "entropy.avail": {
                "label": "Entropy level",
                "options": None,
                "status": status,
                "error_message": msg
            }
        }
        return data

    def check(self, textkey, data, config):
        if textkey == "entropy.avail":
            return float(open("/proc/sys/kernel/random/entropy_avail", "r").read().strip())
        return 0