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 : jmx.py
import agent_util import logging import sys logger = logging.getLogger(__name__) def parse_jmx_config(config): """ Split the jmx configuration into multiple instances based on the number of comma separated instances there are. :param config: Dict :return: List of Dicts """ configs = {} jvm_path = None for key, value in config.items(): if key == "jvm_path": jvm_path = value elif key == "debug": continue else: for i, inner in enumerate(value.split(",")): if i not in configs.keys(): configs[i] = {} if len(value) > 0: configs[i][key] = inner.strip(" ") for key in configs: configs[key]["jvm_path"] = jvm_path if sys.version_info >= (3, 0): return list(configs.values()) else: return configs.values() class JMXPlugin(agent_util.Plugin): textkey = "jmx" label = "JMX" @classmethod def get_metadata(self, config): status = agent_util.SUPPORTED msg = None # Check for jmx configuration block if not config: self.log.info("No JMX configuration found") return {} configs = parse_jmx_config(config) # Check for config setting sin jmx configuration block invalid_configs = [] missing_keys = [] for entry in configs: for key in ["port", "host", "jvm_path"]: if key not in entry.keys(): invalid_configs.append(entry) missing_keys.append(key) configs.remove(entry) if len(invalid_configs) == len(configs): msg = ( "Missing value for %s in the [jmx] block of the agent config file." % missing_keys ) self.log.info(msg) status = agent_util.MISCONFIGURED try: import jpype except: msg = "Unable to access JMX metrics due to missing jpype library." self.log.info(msg) status = agent_util.MISCONFIGURED try: if status == agent_util.SUPPORTED and not jpype.isJVMStarted(): jpype.startJVM(config["jvm_path"]) except: msg = "Unable to access JMX metrics because JVM cannot be started." self.log.info(msg) status = agent_util.MISCONFIGURED if status == agent_util.SUPPORTED: invalid_configs = [] for entry in configs: try: from jpype import java, javax jhash = java.util.HashMap() if config.get("username") and config.get("password"): jarray = jpype.JArray(java.lang.String)( [config["username"], config["password"]] ) jhash.put( javax.management.remote.JMXConnector.CREDENTIALS, jarray ) url = "service:jmx:rmi:///jndi/rmi://%s:%d/jmxrmi" % ( entry["host"], int(entry["port"]), ) jmxurl = javax.management.remote.JMXServiceURL(url) javax.management.remote.JMXConnectorFactory.connect(jmxurl, jhash) except: self.log.exception("Unable to connect to JMX %s" % str(entry)) invalid_configs.append(entry) if len(invalid_configs) == len(configs): msg = ( "Unable to access JMX metrics, JMX is not running or not installed. Check configs %s" % (str(invalid_configs)) ) self.log.info(msg) status = agent_util.MISCONFIGURED metadata = { "jmx.custom": { "label": "Custom JMX Metric", "options": None, "status": status, "error_message": msg, "option_string": True, } } return metadata def check(self, textkey, data, config): try: import jpype from jpype import java, javax configs = parse_jmx_config(config) jvm_path = configs[0]["jvm_path"] try: data, port = data.split("::") except ValueError: port = None # No port came in the data. if len(configs) > 1: self.log.error( "Port information missing from mBean. Unable to pick environment to execute. Aborting" ) return if port: found = False for config in configs: if config["port"] == port: found = True break if not found: # Check sent a port that doesn't match. self.log.error( "Port %s is not one of the configured ones. Check cannot execute" % port ) return if not jpype.isJVMStarted(): jpype.startJVM(jvm_path) jhash = java.util.HashMap() if config.get("username") and config.get("password"): jarray = jpype.JArray(java.lang.String)( [config["username"], config["password"]] ) jhash.put(javax.management.remote.JMXConnector.CREDENTIALS, jarray) url = "service:jmx:rmi:///jndi/rmi://%s:%d/jmxrmi" % ( config["host"], int(config["port"]), ) jmxurl = javax.management.remote.JMXServiceURL(url) jmxsoc = javax.management.remote.JMXConnectorFactory.connect(jmxurl, jhash) connection = jmxsoc.getMBeanServerConnection() """ Look for two Mbeans || separated and calculate the %. The expected input will be: MBean1||MBean2. Example for MemoryHeapUsage: java.lang:type=Memory/HeapMemoryUsage/used||java.lang:type=Memory/HeapMemoryUsage/committed """ if "||" in data: data = data.split("||") # Create a list from the two MBeans || separated. calc = [] for i in data: # Iterate the list to get each MBean value that will be set for the % calculation. res = self._get_bean_value(i, connection) if res is None: return None calc.append(res) return 100 * calc[0] / calc[1] return self._get_bean_value(data, connection) except: self.log.exception("Error gathering JMX metric") return def _get_bean_value(self, bean_str, connection): try: from jpype import javax last_slash = bean_str.rfind("/") if -1 == last_slash: return None obj_name = bean_str[:last_slash] java_obj = javax.management.ObjectName(obj_name) attribute = bean_str[last_slash + 1 :] # self.log.debug('Checking object name {} attr {}'.format(obj_name, attribute)) if connection.isRegistered(java_obj): res = connection.getAttribute(java_obj, attribute) return res.floatValue() last_slash = obj_name.rfind("/") if -1 == last_slash: return None key = attribute next_obj_name = obj_name[:last_slash] java_obj = javax.management.ObjectName(next_obj_name) attribute = obj_name[last_slash + 1 :] # self.log.debug('Checking object name {} attr {}'.format(next_obj_name, attribute)) if connection.isRegistered(java_obj): res = connection.getAttribute(java_obj, attribute) if hasattr(res, "contents"): res = res.contents.get(key) else: res = res.get(key) return res.floatValue() self.log.error("Could not find object name %s" % bean_str) return None except: self.log.exception("_get_bean_value %s caught an exception" % bean_str) return None
Close