Linux 120.141.167.72.host.secureserver.net 4.18.0-553.150.1.el8_10.x86_64 #1 SMP Fri Jul 31 15:23:31 EDT 2026 x86_64
Apache
: 72.167.141.120 | : 216.73.217.14
808 Domain
7.4.33
bestseocompany
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
lib /
fm-agent /
plugins /
[ HOME SHELL ]
Name
Size
Permission
Action
__pycache__
[ DIR ]
drwxr-xr-x
__init__.py
0
B
-rw-r--r--
apache.py
20.07
KB
-rw-r--r--
apache_kafka.py
13.66
KB
-rw-r--r--
apache_zookeeper.py
6.34
KB
-rw-r--r--
bandwidth.py
22.59
KB
-rw-r--r--
cassandra.py
9.46
KB
-rw-r--r--
cert.py
2.89
KB
-rw-r--r--
couch.py
9.56
KB
-rw-r--r--
cpu_usage.py
32.09
KB
-rw-r--r--
dem_plugin.py
7.48
KB
-rw-r--r--
disk.py
16.8
KB
-rw-r--r--
docker.py
38.95
KB
-rw-r--r--
elasticsearch.py
2.9
KB
-rw-r--r--
entropy.py
930
B
-rw-r--r--
exim.py
1
KB
-rw-r--r--
file_presence.py
5.07
KB
-rw-r--r--
fortisase_connection.py
6.99
KB
-rw-r--r--
haproxy.py
13.46
KB
-rw-r--r--
io_stats.py
13.39
KB
-rw-r--r--
jboss.py
13.66
KB
-rw-r--r--
jmx.py
8.39
KB
-rw-r--r--
linux_logs.py
3.34
KB
-rw-r--r--
lm_sensors.py
2.54
KB
-rw-r--r--
logstash_forwarder.py
1.64
KB
-rw-r--r--
memcache.py
6.04
KB
-rw-r--r--
memory_usage.py
26.56
KB
-rw-r--r--
mongo.py
16.61
KB
-rw-r--r--
mysql.py
20.4
KB
-rw-r--r--
nagios.py
5.58
KB
-rw-r--r--
nginx.py
12.33
KB
-rw-r--r--
nodejs.py
6.44
KB
-rw-r--r--
ntp.py
1.98
KB
-rw-r--r--
opcache.py
2.3
KB
-rw-r--r--
oracle.py
15.6
KB
-rw-r--r--
package_upgrade.py
8.88
KB
-rw-r--r--
phpfpm.py
5.61
KB
-rw-r--r--
ping.py
2.6
KB
-rw-r--r--
postfix.py
1.99
KB
-rw-r--r--
postgresql.py
21.37
KB
-rw-r--r--
process.py
17.23
KB
-rw-r--r--
rabbitmq.py
19.85
KB
-rw-r--r--
redis.py
11.31
KB
-rw-r--r--
sendmail.py
2.42
KB
-rw-r--r--
sysctl.py
1.42
KB
-rw-r--r--
tcp.py
6.59
KB
-rw-r--r--
template.py
3.28
KB
-rw-r--r--
tomcat.py
7.09
KB
-rw-r--r--
tomcat_jmx.py
19.11
KB
-rw-r--r--
unbound_dns.py
4.62
KB
-rw-r--r--
uptime.py
3.61
KB
-rw-r--r--
users.py
1.09
KB
-rw-r--r--
uwsgi.py
4.73
KB
-rw-r--r--
varnish.py
4.91
KB
-rw-r--r--
weblogic.py
13.84
KB
-rw-r--r--
weblogic12c.py
19.2
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : nagios.py
import agent_util import os import sys DEFAULT_NAGIOS_FOLDER = "/usr/share/fm-agent/nagios" def parse_performance_data(output, log): """ Parse Nagios performance data, as defined in their API docs at https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/3/en/pluginapi.html Returns a list of dictionaries, each with the following keys (if found in output): - label - value - unit - min_value - max_value """ lines = output.strip().split("\n") # Grab the first line, after the | which is performance data parts = [] if "|" in lines[0]: parts.extend(lines[0].split("|", 1)[1].split(" ")) # Look in rest of output for a | indicating that all the rest is performance data found_perf = False for line in lines[1:]: if not found_perf and "|" in line: found_perf = True line = line.split("|", 1)[1] if found_perf: parts.extend(line.split(" ")) metrics = [] # Parse each part into component pieces for part in parts: metric = {} try: pieces = part.strip().strip(";").split(";") label, value = pieces[0].split("=") metric["label"] = label.strip("'").strip() if value == "U": value = None else: # Split the value from the unit, if it's there unit = "" for i, char in enumerate(value): if char not in "-0123456789.": unit = value[i:] value = value[:i] break value = float(value) metric["value"] = value metric["unit"] = unit # Extract min and max, if present if len(pieces) >= 4: metric["min_value"] = float(pieces[3]) if len(pieces) >= 5: metric["max_value"] = float(pieces[4]) metrics.append(metric) except: log.exception("Error parsing Nagios output: %s" % part) return metrics class NagiosPlugin(agent_util.Plugin): textkey = "nagios" label = "Nagios" @classmethod def get_metadata(self, config): status = agent_util.SUPPORTED msg = None custom_folder = config.get("plugins_location") plugins = self._get_all_plugins(DEFAULT_NAGIOS_FOLDER, custom_folder) if not plugins: status = agent_util.UNSUPPORTED msg = "No nagios plugin found on %s %s" % ( DEFAULT_NAGIOS_FOLDER, custom_folder or "", ) return {} metric_options = [] for dir, plugin in plugins: self.log.info("Found Nagios plugin: %s" % plugin) # Add an option for the return status metric_options.append( { "nagios_script": plugin, "metric": "status", "resource": "%s: status" % (plugin), } ) try: ret_code, output = agent_util.execute_command(os.path.join(dir, plugin)) self.log.info("Nagios: %s %s" % (ret_code, output)) for metric in parse_performance_data(output, self.log): metric_options.append( { "nagios_script": plugin, "metric": metric["label"], "resource": "%s: %s" % (plugin, metric["label"]), } ) except: self.log.exception( "Error gathering metadata for Nagios plugin %s" % plugin ) self.log.info( "%s Nagios options found: %s" % (len(metric_options), metric_options) ) options_schema = { "nagios_script": "string", "metric": "string", "resource": "string", } metadata = { "nagios_metric": { "label": "Nagios Metric", "options": metric_options, "options_schema": options_schema, "status": status, "error_message": msg, } } return metadata @staticmethod def _get_all_plugins(*args): plugins = [] for arg in args: if arg and os.path.isdir(arg): for file in os.listdir(arg): if os.access(os.path.join(arg, file), os.X_OK): plugins.append((arg, file)) return plugins def check(self, textkey, plugin_metric, config): split = plugin_metric.split(":") plugin_name = split[0].strip() metric_name = split[1].strip() custom_folder = config.get("plugins_location") plugins = self._get_all_plugins(DEFAULT_NAGIOS_FOLDER, custom_folder) for dir, plugin in plugins: if plugin == plugin_name: self.log.debug( "Executing %s to get %s" % (os.path.join(dir, plugin), textkey) ) ret_code, output = agent_util.execute_command(os.path.join(dir, plugin)) self.log.debug("Nagios: %s %s" % (ret_code, output)) if metric_name == "status": return ret_code for metric in parse_performance_data(output, self.log): if metric["label"] == metric_name: return metric["value"] self.log.info("No matching Nagios plugin found for %s" % textkey) return None
Close